Built motion from commit da617fac.|2.6.6
[motion2.git] / server / services / agi / scripts / aws / polly / lib / api.js
index 6edad69..92a1f4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf42b=['aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0xf42b,0x80));var _0xbf42=function(_0x294ba2,_0x17be38){_0x294ba2=_0x294ba2-0x0;var _0xd857e6=_0xf42b[_0x294ba2];return _0xd857e6;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xbf42('0x0'));var rs=require(_0xbf42('0x1'));var AWS=require(_0xbf42('0x2'));function pollyResult(_0x4d45f5,_0x189519,_0x151ecf){return new BPromise(function(_0x1e772f,_0x3e5375){_0x4d45f5['synthesizeSpeech'](_0x189519,function(_0x2fb637,_0x121f38){if(_0x2fb637){_0x3e5375(_0x2fb637);}else if(_0x121f38){if(_0x121f38[_0xbf42('0x3')]instanceof Buffer){fs[_0xbf42('0x4')](_0x151ecf,_0x121f38['AudioStream'],function(_0xdb6436){if(_0xdb6436){_0x3e5375(_0xdb6436);}else{_0x1e772f();}});}else{_0x3e5375(new Error(_0xbf42('0x5')));}}else{_0x3e5375(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xbf42('0x6')]=function(_0x444bac,_0x5332a0,_0x5864e5,_0x220dd3,_0x52360f,_0x1cfd1f,_0x4b9ba7){var _0x348649=new AWS[(_0xbf42('0x7'))]({'accessKeyId':_0x444bac,'secretAccessKey':_0x5332a0,'region':_0x5864e5});var _0x29588c={'Text':_0x52360f,'TextType':_0x1cfd1f||_0xbf42('0x8'),'OutputFormat':_0xbf42('0x9'),'VoiceId':_0x220dd3};return pollyResult(_0x348649,_0x29588c,_0x4b9ba7);};
\ No newline at end of file
+var _0xf2f7=['mp3','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text'];(function(_0x1115f5,_0x137af2){var _0x20029b=function(_0x45698f){while(--_0x45698f){_0x1115f5['push'](_0x1115f5['shift']());}};_0x20029b(++_0x137af2);}(_0xf2f7,0x13c));var _0x7f2f=function(_0x27a5dd,_0x35cde6){_0x27a5dd=_0x27a5dd-0x0;var _0x523a2d=_0xf2f7[_0x27a5dd];return _0x523a2d;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require('bluebird');var rs=require(_0x7f2f('0x0'));var AWS=require('aws-sdk');function pollyResult(_0x266b55,_0x45cb0b,_0x8dd364){return new BPromise(function(_0x1d62db,_0x4bb232){_0x266b55[_0x7f2f('0x1')](_0x45cb0b,function(_0x140c29,_0x12469b){if(_0x140c29){_0x4bb232(_0x140c29);}else if(_0x12469b){if(_0x12469b[_0x7f2f('0x2')]instanceof Buffer){fs[_0x7f2f('0x3')](_0x8dd364,_0x12469b['AudioStream'],function(_0x52b580){if(_0x52b580){_0x4bb232(_0x52b580);}else{_0x1d62db();}});}else{_0x4bb232(new Error(_0x7f2f('0x4')));}}else{_0x4bb232(new Error(_0x7f2f('0x5')));}});});}module['exports']=function(_0x209441,_0x2926e7,_0x11d63f,_0x169cc9,_0x31a34f,_0x1c1ae2,_0x411efb){var _0x294fab=new AWS[(_0x7f2f('0x6'))]({'accessKeyId':_0x209441,'secretAccessKey':_0x2926e7,'region':_0x11d63f});var _0x18cdd2={'Text':_0x31a34f,'TextType':_0x1c1ae2||_0x7f2f('0x7'),'OutputFormat':_0x7f2f('0x8'),'VoiceId':_0x169cc9};return pollyResult(_0x294fab,_0x18cdd2,_0x411efb);};
\ No newline at end of file