Built motion from commit e781dc3c.|2.5.42
[motion2.git] / server / services / agi / scripts / aws / polly / lib / api.js
index 19c2199..fe521b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf6a=['aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','randomstring'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0xcf6a,0xa8));var _0xacf6=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xcf6a[_0x1f9f37];return _0x21c080;};'use strict';var fs=require('fs');var path=require(_0xacf6('0x0'));var BPromise=require('bluebird');var rs=require(_0xacf6('0x1'));var AWS=require(_0xacf6('0x2'));function pollyResult(_0x329c85,_0x4c8623,_0x50b9ec){return new BPromise(function(_0x27091d,_0x118c9e){_0x329c85['synthesizeSpeech'](_0x4c8623,function(_0x449317,_0x1da3a7){if(_0x449317){_0x118c9e(_0x449317);}else if(_0x1da3a7){if(_0x1da3a7[_0xacf6('0x3')]instanceof Buffer){fs[_0xacf6('0x4')](_0x50b9ec,_0x1da3a7[_0xacf6('0x3')],function(_0x5a1a17){if(_0x5a1a17){_0x118c9e(_0x5a1a17);}else{_0x27091d();}});}else{_0x118c9e(new Error(_0xacf6('0x5')));}}else{_0x118c9e(new Error(_0xacf6('0x6')));}});});}module[_0xacf6('0x7')]=function(_0xc5114d,_0x354d9b,_0x5c120d,_0x5a79d4,_0xecca2c,_0x3c3e39,_0x5be53){var _0x222ca2=new AWS[(_0xacf6('0x8'))]({'accessKeyId':_0xc5114d,'secretAccessKey':_0x354d9b,'region':_0x5c120d});var _0x2623c5={'Text':_0xecca2c,'TextType':_0x3c3e39||_0xacf6('0x9'),'OutputFormat':'mp3','VoiceId':_0x5a79d4};return pollyResult(_0x222ca2,_0x2623c5,_0x5be53);};
\ No newline at end of file
+var _0x6958=['path','bluebird','aws-sdk','synthesizeSpeech','AudioStream','writeFile','exports','Polly'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x6958,0x88));var _0x8695=function(_0x3659f7,_0x562293){_0x3659f7=_0x3659f7-0x0;var _0x3a0739=_0x6958[_0x3659f7];return _0x3a0739;};'use strict';var fs=require('fs');var path=require(_0x8695('0x0'));var BPromise=require(_0x8695('0x1'));var rs=require('randomstring');var AWS=require(_0x8695('0x2'));function pollyResult(_0x1e9ecf,_0x54aa45,_0x19abc0){return new BPromise(function(_0x3b057a,_0x2a3127){_0x1e9ecf[_0x8695('0x3')](_0x54aa45,function(_0x541020,_0x51877d){if(_0x541020){_0x2a3127(_0x541020);}else if(_0x51877d){if(_0x51877d[_0x8695('0x4')]instanceof Buffer){fs[_0x8695('0x5')](_0x19abc0,_0x51877d[_0x8695('0x4')],function(_0x479bd5){if(_0x479bd5){_0x2a3127(_0x479bd5);}else{_0x3b057a();}});}else{_0x2a3127(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x2a3127(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x8695('0x6')]=function(_0x375754,_0xcf8c25,_0x5255aa,_0x17ed2d,_0x5efa92,_0xa4bb4f,_0x52e238){var _0x59c0eb=new AWS[(_0x8695('0x7'))]({'accessKeyId':_0x375754,'secretAccessKey':_0xcf8c25,'region':_0x5255aa});var _0x299edf={'Text':_0x5efa92,'TextType':_0xa4bb4f||'text','OutputFormat':'mp3','VoiceId':_0x17ed2d};return pollyResult(_0x59c0eb,_0x299edf,_0x52e238);};
\ No newline at end of file