Built motion from commit c0cdc9d8.|2.6.28
[motion2.git] / server / services / agi / scripts / aws / polly / lib / api.js
index 2bb01de..49d226d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f85=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','synthesizeSpeech'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9f85,0x9f));var _0x59f8=function(_0x58d722,_0x239a59){_0x58d722=_0x58d722-0x0;var _0x486753=_0x9f85[_0x58d722];return _0x486753;};'use strict';var fs=require('fs');var path=require(_0x59f8('0x0'));var BPromise=require(_0x59f8('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x1e0f16,_0x4db1d1,_0x2a081d){return new BPromise(function(_0x3d97cf,_0x3bb1f5){_0x1e0f16[_0x59f8('0x2')](_0x4db1d1,function(_0x1ab89c,_0x5b6f0b){if(_0x1ab89c){_0x3bb1f5(_0x1ab89c);}else if(_0x5b6f0b){if(_0x5b6f0b[_0x59f8('0x3')]instanceof Buffer){fs['writeFile'](_0x2a081d,_0x5b6f0b[_0x59f8('0x3')],function(_0x2f5bf7){if(_0x2f5bf7){_0x3bb1f5(_0x2f5bf7);}else{_0x3d97cf();}});}else{_0x3bb1f5(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x3bb1f5(new Error(_0x59f8('0x4')));}});});}module[_0x59f8('0x5')]=function(_0x262bfb,_0x53553e,_0x1e3eb2,_0xe335d3,_0x5b3ba7,_0x331d90,_0x5a50dd){var _0x51c41c=new AWS[(_0x59f8('0x6'))]({'accessKeyId':_0x262bfb,'secretAccessKey':_0x53553e,'region':_0x1e3eb2});var _0x4a6a9b={'Text':_0x5b3ba7,'TextType':_0x331d90||_0x59f8('0x7'),'OutputFormat':_0x59f8('0x8'),'VoiceId':_0xe335d3};return pollyResult(_0x51c41c,_0x4a6a9b,_0x5a50dd);};
\ No newline at end of file
+var _0xc1a7=['exports','Polly','text','mp3','path','synthesizeSpeech','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x497513,_0x114370){var _0x94baac=function(_0x2b8311){while(--_0x2b8311){_0x497513['push'](_0x497513['shift']());}};_0x94baac(++_0x114370);}(_0xc1a7,0x136));var _0x7c1a=function(_0x2aab8e,_0x440d3b){_0x2aab8e=_0x2aab8e-0x0;var _0x2a67=_0xc1a7[_0x2aab8e];return _0x2a67;};'use strict';var fs=require('fs');var path=require(_0x7c1a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x17bfb0,_0x19ef08,_0x58c2dd){return new BPromise(function(_0x3cfbec,_0xb74393){_0x17bfb0[_0x7c1a('0x1')](_0x19ef08,function(_0x44d23d,_0x2f7654){if(_0x44d23d){_0xb74393(_0x44d23d);}else if(_0x2f7654){if(_0x2f7654['AudioStream']instanceof Buffer){fs[_0x7c1a('0x2')](_0x58c2dd,_0x2f7654['AudioStream'],function(_0x1b5bfc){if(_0x1b5bfc){_0xb74393(_0x1b5bfc);}else{_0x3cfbec();}});}else{_0xb74393(new Error(_0x7c1a('0x3')));}}else{_0xb74393(new Error(_0x7c1a('0x4')));}});});}module[_0x7c1a('0x5')]=function(_0xe89f1e,_0x81fd60,_0x2fc704,_0x43e69a,_0x39dcad,_0x30a1d6,_0x55ee62){var _0x10b6e3=new AWS[(_0x7c1a('0x6'))]({'accessKeyId':_0xe89f1e,'secretAccessKey':_0x81fd60,'region':_0x2fc704});var _0x16a4c9={'Text':_0x39dcad,'TextType':_0x30a1d6||_0x7c1a('0x7'),'OutputFormat':_0x7c1a('0x8'),'VoiceId':_0x43e69a};return pollyResult(_0x10b6e3,_0x16a4c9,_0x55ee62);};
\ No newline at end of file