Built motion from commit cafec4f3.|2.6.31
[motion2.git] / server / services / agi / scripts / google / asr / lib / api.js
index db0e72c..5b5c553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe644=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length'];(function(_0x35031c,_0x3807cd){var _0x35cb18=function(_0x698362){while(--_0x698362){_0x35031c['push'](_0x35031c['shift']());}};_0x35cb18(++_0x3807cd);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0x4e64('0x0'));var BPromise=require(_0x4e64('0x1'));var fs=require('fs');var host=_0x4e64('0x2');module[_0x4e64('0x3')]=function(_0x18e17a,_0x1c5c75,_0x5e2d61){return new BPromise(function(_0x29c930,_0x7b06ee){var _0x2f5ef0;if(typeof _0x18e17a!==_0x4e64('0x4')||_0x18e17a[_0x4e64('0x5')]===0x0){return _0x7b06ee(_0x4e64('0x6'));}if(typeof _0x1c5c75!=='string'||_0x1c5c75[_0x4e64('0x5')]===0x0){return _0x7b06ee(_0x4e64('0x7'));}if(typeof _0x5e2d61!=='undefined'&&(typeof _0x5e2d61!=='string'||_0x5e2d61[_0x4e64('0x5')]===0x0)){return _0x7b06ee('lang\x20should\x20be\x20a\x20string');}try{_0x2f5ef0=fs['readFileSync'](_0x18e17a)[_0x4e64('0x8')](_0x4e64('0x9'));}catch(_0x4323bb){return _0x7b06ee(_0x4323bb);}return _0x29c930({'method':_0x4e64('0xa'),'uri':host+_0x4e64('0xb')+_0x1c5c75,'body':{'config':{'encoding':_0x4e64('0xc'),'sampleRateHertz':'8000','languageCode':_0x5e2d61},'audio':{'content':_0x2f5ef0}},'json':!![]});});};
\ No newline at end of file
+var _0xd64b=['undefined','lang\x20should\x20be\x20a\x20string','base64','POST','LINEAR16','8000','url','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string'];(function(_0x588172,_0x1540fa){var _0x5089a1=function(_0x5d01b6){while(--_0x5d01b6){_0x588172['push'](_0x588172['shift']());}};_0x5089a1(++_0x1540fa);}(_0xd64b,0xc1));var _0xbd64=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0xd64b[_0x156a0d];return _0x98a9ba;};'use strict';var url=require(_0xbd64('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xbd64('0x1');module['exports']=function(_0x30b9b3,_0xcbecd5,_0x64bd3b){return new BPromise(function(_0x3f1f05,_0x30fe29){var _0x5458d8;if(typeof _0x30b9b3!=='string'||_0x30b9b3['length']===0x0){return _0x30fe29('filepath\x20should\x20be\x20a\x20string');}if(typeof _0xcbecd5!==_0xbd64('0x2')||_0xcbecd5[_0xbd64('0x3')]===0x0){return _0x30fe29(_0xbd64('0x4'));}if(typeof _0x64bd3b!==_0xbd64('0x5')&&(typeof _0x64bd3b!==_0xbd64('0x2')||_0x64bd3b[_0xbd64('0x3')]===0x0)){return _0x30fe29(_0xbd64('0x6'));}try{_0x5458d8=fs['readFileSync'](_0x30b9b3)['toString'](_0xbd64('0x7'));}catch(_0xde7cc8){return _0x30fe29(_0xde7cc8);}return _0x3f1f05({'method':_0xbd64('0x8'),'uri':host+'/v1/speech:recognize?key='+_0xcbecd5,'body':{'config':{'encoding':_0xbd64('0x9'),'sampleRateHertz':_0xbd64('0xa'),'languageCode':_0x64bd3b},'audio':{'content':_0x5458d8}},'json':!![]});});};
\ No newline at end of file