Built motion from commit b58257bb.|2.5.37
[motion2.git] / server / services / agi / scripts / aws / polly / lib / api.js
index a4c9342..5578576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9230=['randomstring','aws-sdk','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','path','bluebird'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x9230,0x1c0));var _0x0923=function(_0x50cf73,_0x5501cb){_0x50cf73=_0x50cf73-0x0;var _0x4ec887=_0x9230[_0x50cf73];return _0x4ec887;};'use strict';var fs=require('fs');var path=require(_0x0923('0x0'));var BPromise=require(_0x0923('0x1'));var rs=require(_0x0923('0x2'));var AWS=require(_0x0923('0x3'));function pollyResult(_0x5805b7,_0x2715e1,_0x3b72d3){return new BPromise(function(_0x3dd771,_0x55212c){_0x5805b7['synthesizeSpeech'](_0x2715e1,function(_0x138062,_0x1b6279){if(_0x138062){_0x55212c(_0x138062);}else if(_0x1b6279){if(_0x1b6279['AudioStream']instanceof Buffer){fs[_0x0923('0x4')](_0x3b72d3,_0x1b6279['AudioStream'],function(_0x36aa2a){if(_0x36aa2a){_0x55212c(_0x36aa2a);}else{_0x3dd771();}});}else{_0x55212c(new Error(_0x0923('0x5')));}}else{_0x55212c(new Error(_0x0923('0x6')));}});});}module[_0x0923('0x7')]=function(_0x4090d8,_0x395e70,_0x122a86,_0x2d4957,_0x12691e,_0xc821a4,_0x34088e){var _0x5459eb=new AWS['Polly']({'accessKeyId':_0x4090d8,'secretAccessKey':_0x395e70,'region':_0x122a86});var _0x56cf33={'Text':_0x12691e,'TextType':_0xc821a4||_0x0923('0x8'),'OutputFormat':'mp3','VoiceId':_0x2d4957};return pollyResult(_0x5459eb,_0x56cf33,_0x34088e);};
\ No newline at end of file
+var _0xff40=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','bluebird'];(function(_0x51ec34,_0x3f94dd){var _0x4fbb32=function(_0x201088){while(--_0x201088){_0x51ec34['push'](_0x51ec34['shift']());}};_0x4fbb32(++_0x3f94dd);}(_0xff40,0x1af));var _0x0ff4=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xff40[_0x23e7c1];return _0x1add43;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x0ff4('0x0'));var rs=require(_0x0ff4('0x1'));var AWS=require(_0x0ff4('0x2'));function pollyResult(_0x541d80,_0x1739db,_0x5e84bf){return new BPromise(function(_0x1c64cb,_0x4c3f0f){_0x541d80[_0x0ff4('0x3')](_0x1739db,function(_0x448330,_0x5d619b){if(_0x448330){_0x4c3f0f(_0x448330);}else if(_0x5d619b){if(_0x5d619b[_0x0ff4('0x4')]instanceof Buffer){fs['writeFile'](_0x5e84bf,_0x5d619b[_0x0ff4('0x4')],function(_0x4e45b4){if(_0x4e45b4){_0x4c3f0f(_0x4e45b4);}else{_0x1c64cb();}});}else{_0x4c3f0f(new Error(_0x0ff4('0x5')));}}else{_0x4c3f0f(new Error(_0x0ff4('0x6')));}});});}module['exports']=function(_0x4e65bb,_0x248d84,_0x2209b7,_0x262532,_0x19d818,_0x1bff82,_0x2db7b2){var _0x3e3c33=new AWS[(_0x0ff4('0x7'))]({'accessKeyId':_0x4e65bb,'secretAccessKey':_0x248d84,'region':_0x2209b7});var _0xaacf4e={'Text':_0x19d818,'TextType':_0x1bff82||'text','OutputFormat':'mp3','VoiceId':_0x262532};return pollyResult(_0x3e3c33,_0xaacf4e,_0x2db7b2);};
\ No newline at end of file