Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / services / agi / scripts / aws / polly / lib / api.js
index 1eea4b7..891952a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec21=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','bluebird','aws-sdk','synthesizeSpeech','writeFile','AudioStream'];(function(_0x9a6891,_0x5e1eff){var _0x831b01=function(_0x9135a3){while(--_0x9135a3){_0x9a6891['push'](_0x9a6891['shift']());}};_0x831b01(++_0x5e1eff);}(_0xec21,0x15a));var _0x1ec2=function(_0x5452c9,_0xc7ea83){_0x5452c9=_0x5452c9-0x0;var _0x2ca4e1=_0xec21[_0x5452c9];return _0x2ca4e1;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x1ec2('0x0'));var rs=require('randomstring');var AWS=require(_0x1ec2('0x1'));function pollyResult(_0x341b76,_0x59a378,_0x42e45b){return new BPromise(function(_0x3f01a1,_0x196cd1){_0x341b76[_0x1ec2('0x2')](_0x59a378,function(_0x12bfd9,_0x536800){if(_0x12bfd9){_0x196cd1(_0x12bfd9);}else if(_0x536800){if(_0x536800['AudioStream']instanceof Buffer){fs[_0x1ec2('0x3')](_0x42e45b,_0x536800[_0x1ec2('0x4')],function(_0x554413){if(_0x554413){_0x196cd1(_0x554413);}else{_0x3f01a1();}});}else{_0x196cd1(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x196cd1(new Error(_0x1ec2('0x5')));}});});}module[_0x1ec2('0x6')]=function(_0x3b6764,_0x10ad5f,_0x453de9,_0x1750b8,_0x515e4e,_0x5e15dc,_0xb3df5){var _0x4b4346=new AWS[(_0x1ec2('0x7'))]({'accessKeyId':_0x3b6764,'secretAccessKey':_0x10ad5f,'region':_0x453de9});var _0x5bdabf={'Text':_0x515e4e,'TextType':_0x5e15dc||_0x1ec2('0x8'),'OutputFormat':'mp3','VoiceId':_0x1750b8};return pollyResult(_0x4b4346,_0x5bdabf,_0xb3df5);};
\ No newline at end of file
+var _0xff27=['bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xff27,0xb0));var _0x7ff2=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xff27[_0x2459fd];return _0x364cd2;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x7ff2('0x0'));var rs=require('randomstring');var AWS=require(_0x7ff2('0x1'));function pollyResult(_0x254e77,_0x12a305,_0x2aa3ee){return new BPromise(function(_0x40adee,_0x2f66e8){_0x254e77[_0x7ff2('0x2')](_0x12a305,function(_0x4b4e1c,_0x387d23){if(_0x4b4e1c){_0x2f66e8(_0x4b4e1c);}else if(_0x387d23){if(_0x387d23[_0x7ff2('0x3')]instanceof Buffer){fs['writeFile'](_0x2aa3ee,_0x387d23[_0x7ff2('0x3')],function(_0x7c22ba){if(_0x7c22ba){_0x2f66e8(_0x7c22ba);}else{_0x40adee();}});}else{_0x2f66e8(new Error(_0x7ff2('0x4')));}}else{_0x2f66e8(new Error(_0x7ff2('0x5')));}});});}module['exports']=function(_0x2702ff,_0x137c35,_0x4e0a9f,_0x26336e,_0x4b4fb7,_0x2bc433,_0x5ea545){var _0x22d403=new AWS['Polly']({'accessKeyId':_0x2702ff,'secretAccessKey':_0x137c35,'region':_0x4e0a9f});var _0x2a0172={'Text':_0x4b4fb7,'TextType':_0x2bc433||_0x7ff2('0x6'),'OutputFormat':_0x7ff2('0x7'),'VoiceId':_0x26336e};return pollyResult(_0x22d403,_0x2a0172,_0x5ea545);};
\ No newline at end of file