Built motion from commit d301b742.|2.6.29
[motion2.git] / server / services / agi / scripts / aws / polly / lib / api.js
index 59f0cbd..fb3f78a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac20=['exports','Polly','mp3','path','bluebird','aws-sdk','synthesizeSpeech','writeFile','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xac20,0xcb));var _0x0ac2=function(_0x464310,_0x1a8fd7){_0x464310=_0x464310-0x0;var _0x1d0374=_0xac20[_0x464310];return _0x1d0374;};'use strict';var fs=require('fs');var path=require(_0x0ac2('0x0'));var BPromise=require(_0x0ac2('0x1'));var rs=require('randomstring');var AWS=require(_0x0ac2('0x2'));function pollyResult(_0x55a5b4,_0x340cb9,_0x2cb745){return new BPromise(function(_0x2b54e2,_0xfe2bb4){_0x55a5b4[_0x0ac2('0x3')](_0x340cb9,function(_0x1bb431,_0x1e59a9){if(_0x1bb431){_0xfe2bb4(_0x1bb431);}else if(_0x1e59a9){if(_0x1e59a9['AudioStream']instanceof Buffer){fs[_0x0ac2('0x4')](_0x2cb745,_0x1e59a9[_0x0ac2('0x5')],function(_0x1a3fff){if(_0x1a3fff){_0xfe2bb4(_0x1a3fff);}else{_0x2b54e2();}});}else{_0xfe2bb4(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0xfe2bb4(new Error(_0x0ac2('0x6')));}});});}module[_0x0ac2('0x7')]=function(_0x2a9062,_0xa22cd,_0x5e3218,_0x301eff,_0x595f52,_0x3ef7ba,_0x41b3e3){var _0x42decf=new AWS[(_0x0ac2('0x8'))]({'accessKeyId':_0x2a9062,'secretAccessKey':_0xa22cd,'region':_0x5e3218});var _0xcfa0ae={'Text':_0x595f52,'TextType':_0x3ef7ba||'text','OutputFormat':_0x0ac2('0x9'),'VoiceId':_0x301eff};return pollyResult(_0x42decf,_0xcfa0ae,_0x41b3e3);};
\ No newline at end of file
+var _0xae09=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xae09,0xb9));var _0x9ae0=function(_0x15a004,_0x371f70){_0x15a004=_0x15a004-0x0;var _0xaf8f1d=_0xae09[_0x15a004];return _0xaf8f1d;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x9ae0('0x0'));var rs=require(_0x9ae0('0x1'));var AWS=require(_0x9ae0('0x2'));function pollyResult(_0x87e082,_0x892b27,_0x51dfec){return new BPromise(function(_0x29dbde,_0x12e24a){_0x87e082[_0x9ae0('0x3')](_0x892b27,function(_0x425952,_0x56441b){if(_0x425952){_0x12e24a(_0x425952);}else if(_0x56441b){if(_0x56441b['AudioStream']instanceof Buffer){fs[_0x9ae0('0x4')](_0x51dfec,_0x56441b['AudioStream'],function(_0x16619c){if(_0x16619c){_0x12e24a(_0x16619c);}else{_0x29dbde();}});}else{_0x12e24a(new Error(_0x9ae0('0x5')));}}else{_0x12e24a(new Error(_0x9ae0('0x6')));}});});}module[_0x9ae0('0x7')]=function(_0x27ed3f,_0x29dd9f,_0x13de66,_0xb0ee5,_0x4c0447,_0x1ccced,_0x3a477c){var _0x586d7e=new AWS[(_0x9ae0('0x8'))]({'accessKeyId':_0x27ed3f,'secretAccessKey':_0x29dd9f,'region':_0x13de66});var _0x5311c5={'Text':_0x4c0447,'TextType':_0x1ccced||'text','OutputFormat':_0x9ae0('0x9'),'VoiceId':_0xb0ee5};return pollyResult(_0x586d7e,_0x5311c5,_0x3a477c);};
\ No newline at end of file