Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / services / agi / scripts / aws / polly / lib / api.js
index d55eb8a..48820b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc45=['exports','Polly','text','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x1e99bc,_0x3a0006){var _0x281232=function(_0x11c8cb){while(--_0x11c8cb){_0x1e99bc['push'](_0x1e99bc['shift']());}};_0x281232(++_0x3a0006);}(_0xfc45,0x19d));var _0x5fc4=function(_0x158391,_0x4adafa){_0x158391=_0x158391-0x0;var _0x53c7f2=_0xfc45[_0x158391];return _0x53c7f2;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x5fc4('0x0'));var rs=require(_0x5fc4('0x1'));var AWS=require(_0x5fc4('0x2'));function pollyResult(_0x325a4a,_0x102c96,_0xc8ca0f){return new BPromise(function(_0x8935b1,_0x1243c9){_0x325a4a['synthesizeSpeech'](_0x102c96,function(_0x49b38f,_0x1bb5eb){if(_0x49b38f){_0x1243c9(_0x49b38f);}else if(_0x1bb5eb){if(_0x1bb5eb[_0x5fc4('0x3')]instanceof Buffer){fs[_0x5fc4('0x4')](_0xc8ca0f,_0x1bb5eb['AudioStream'],function(_0x422887){if(_0x422887){_0x1243c9(_0x422887);}else{_0x8935b1();}});}else{_0x1243c9(new Error(_0x5fc4('0x5')));}}else{_0x1243c9(new Error(_0x5fc4('0x6')));}});});}module[_0x5fc4('0x7')]=function(_0x24af3d,_0x1d4b01,_0x49a03b,_0x34ad5b,_0x46f768,_0xc9a167,_0x1e131e){var _0x5271cb=new AWS[(_0x5fc4('0x8'))]({'accessKeyId':_0x24af3d,'secretAccessKey':_0x1d4b01,'region':_0x49a03b});var _0x37ac9d={'Text':_0x46f768,'TextType':_0xc9a167||_0x5fc4('0x9'),'OutputFormat':'mp3','VoiceId':_0x34ad5b};return pollyResult(_0x5271cb,_0x37ac9d,_0x1e131e);};
\ No newline at end of file
+var _0xcf77=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x17e4fb,_0xb18021){var _0x18c91f=function(_0x5dc4d0){while(--_0x5dc4d0){_0x17e4fb['push'](_0x17e4fb['shift']());}};_0x18c91f(++_0xb18021);}(_0xcf77,0x1d3));var _0x7cf7=function(_0x2cac79,_0x4933ed){_0x2cac79=_0x2cac79-0x0;var _0x353569=_0xcf77[_0x2cac79];return _0x353569;};'use strict';var fs=require('fs');var path=require(_0x7cf7('0x0'));var BPromise=require(_0x7cf7('0x1'));var rs=require(_0x7cf7('0x2'));var AWS=require(_0x7cf7('0x3'));function pollyResult(_0x376def,_0x4637e7,_0x3d3b3c){return new BPromise(function(_0x28313d,_0x23e156){_0x376def[_0x7cf7('0x4')](_0x4637e7,function(_0x50b123,_0x31071e){if(_0x50b123){_0x23e156(_0x50b123);}else if(_0x31071e){if(_0x31071e[_0x7cf7('0x5')]instanceof Buffer){fs['writeFile'](_0x3d3b3c,_0x31071e[_0x7cf7('0x5')],function(_0xf1fddb){if(_0xf1fddb){_0x23e156(_0xf1fddb);}else{_0x28313d();}});}else{_0x23e156(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x23e156(new Error(_0x7cf7('0x6')));}});});}module[_0x7cf7('0x7')]=function(_0x261476,_0x3faaf0,_0x59f8c9,_0x234e8b,_0x544c7c,_0x18c5f2,_0x159ba0){var _0x207a83=new AWS[(_0x7cf7('0x8'))]({'accessKeyId':_0x261476,'secretAccessKey':_0x3faaf0,'region':_0x59f8c9});var _0x27b3da={'Text':_0x544c7c,'TextType':_0x18c5f2||_0x7cf7('0x9'),'OutputFormat':_0x7cf7('0xa'),'VoiceId':_0x234e8b};return pollyResult(_0x207a83,_0x27b3da,_0x159ba0);};
\ No newline at end of file