Built motion from commit 7ab0e143.|2.5.49
[motion2.git] / server / services / agi / scripts / google / asr / lib / api.js
index 443c846..9f1f5f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c50=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','LINEAR16','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x462753,_0x18db45){var _0x241048=function(_0x165ef6){while(--_0x165ef6){_0x462753['push'](_0x462753['shift']());}};_0x241048(++_0x18db45);}(_0x6c50,0xa4));var _0x06c5=function(_0x2fab63,_0x476d53){_0x2fab63=_0x2fab63-0x0;var _0x14188f=_0x6c50[_0x2fab63];return _0x14188f;};'use strict';var url=require(_0x06c5('0x0'));var BPromise=require(_0x06c5('0x1'));var fs=require('fs');var host=_0x06c5('0x2');module[_0x06c5('0x3')]=function(_0x495adf,_0xd66539,_0x494494){return new BPromise(function(_0x4271d1,_0x2853be){var _0x434003;if(typeof _0x495adf!==_0x06c5('0x4')||_0x495adf[_0x06c5('0x5')]===0x0){return _0x2853be(_0x06c5('0x6'));}if(typeof _0xd66539!==_0x06c5('0x4')||_0xd66539[_0x06c5('0x5')]===0x0){return _0x2853be(_0x06c5('0x7'));}if(typeof _0x494494!==_0x06c5('0x8')&&(typeof _0x494494!==_0x06c5('0x4')||_0x494494['length']===0x0)){return _0x2853be(_0x06c5('0x9'));}try{_0x434003=fs[_0x06c5('0xa')](_0x495adf)[_0x06c5('0xb')](_0x06c5('0xc'));}catch(_0x4e863c){return _0x2853be(_0x4e863c);}return _0x4271d1({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0xd66539,'body':{'config':{'encoding':_0x06c5('0xd'),'sampleRateHertz':'8000','languageCode':_0x494494},'audio':{'content':_0x434003}},'json':!![]});});};
\ No newline at end of file
+var _0xa9e0=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string'];(function(_0x184ec6,_0x1a8c31){var _0x651574=function(_0x586b2f){while(--_0x586b2f){_0x184ec6['push'](_0x184ec6['shift']());}};_0x651574(++_0x1a8c31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var url=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var fs=require('fs');var host=_0x0a9e('0x2');module['exports']=function(_0x550fbc,_0x18d5c9,_0x4ce2f1){return new BPromise(function(_0x333808,_0x432180){var _0x2ab90b;if(typeof _0x550fbc!==_0x0a9e('0x3')||_0x550fbc[_0x0a9e('0x4')]===0x0){return _0x432180('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x18d5c9!==_0x0a9e('0x3')||_0x18d5c9[_0x0a9e('0x4')]===0x0){return _0x432180(_0x0a9e('0x5'));}if(typeof _0x4ce2f1!=='undefined'&&(typeof _0x4ce2f1!=='string'||_0x4ce2f1[_0x0a9e('0x4')]===0x0)){return _0x432180('lang\x20should\x20be\x20a\x20string');}try{_0x2ab90b=fs['readFileSync'](_0x550fbc)[_0x0a9e('0x6')](_0x0a9e('0x7'));}catch(_0x307b3e){return _0x432180(_0x307b3e);}return _0x333808({'method':_0x0a9e('0x8'),'uri':host+_0x0a9e('0x9')+_0x18d5c9,'body':{'config':{'encoding':_0x0a9e('0xa'),'sampleRateHertz':'8000','languageCode':_0x4ce2f1},'audio':{'content':_0x2ab90b}},'json':!![]});});};
\ No newline at end of file