Built motion from commit a8c4dd89.|2.6.33
[motion2.git] / server / services / agi / scripts / google / asr / lib / api.js
index 8701e3f..0423f03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird'];(function(_0x34b413,_0x5f159f){var _0x2455fc=function(_0x20c1f2){while(--_0x20c1f2){_0x34b413['push'](_0x34b413['shift']());}};_0x2455fc(++_0x5f159f);}(_0x54ef,0x112));var _0xf54e=function(_0x39f983,_0x310a5a){_0x39f983=_0x39f983-0x0;var _0x473279=_0x54ef[_0x39f983];return _0x473279;};'use strict';var url=require(_0xf54e('0x0'));var BPromise=require(_0xf54e('0x1'));var fs=require('fs');var host=_0xf54e('0x2');module['exports']=function(_0xd936f7,_0x18b7d6,_0x18b1cf){return new BPromise(function(_0x42b9b2,_0x8b6bb6){var _0x431e36;if(typeof _0xd936f7!==_0xf54e('0x3')||_0xd936f7['length']===0x0){return _0x8b6bb6('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x18b7d6!==_0xf54e('0x3')||_0x18b7d6[_0xf54e('0x4')]===0x0){return _0x8b6bb6(_0xf54e('0x5'));}if(typeof _0x18b1cf!=='undefined'&&(typeof _0x18b1cf!==_0xf54e('0x3')||_0x18b1cf['length']===0x0)){return _0x8b6bb6(_0xf54e('0x6'));}try{_0x431e36=fs[_0xf54e('0x7')](_0xd936f7)['toString'](_0xf54e('0x8'));}catch(_0xefa1c0){return _0x8b6bb6(_0xefa1c0);}return _0x42b9b2({'method':_0xf54e('0x9'),'uri':host+_0xf54e('0xa')+_0x18b7d6,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xf54e('0xb'),'languageCode':_0x18b1cf},'audio':{'content':_0x431e36}},'json':!![]});});};
\ No newline at end of file
+var _0x26c2=['readFileSync','toString','POST','8000','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string'];(function(_0x38d682,_0x5766ef){var _0x4c22b5=function(_0x2ee576){while(--_0x2ee576){_0x38d682['push'](_0x38d682['shift']());}};_0x4c22b5(++_0x5766ef);}(_0x26c2,0x130));var _0x226c=function(_0x279171,_0x195a91){_0x279171=_0x279171-0x0;var _0x574ab0=_0x26c2[_0x279171];return _0x574ab0;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x226c('0x0')]=function(_0x23ec98,_0x674a14,_0x3b56e8){return new BPromise(function(_0x5e55b3,_0x2f79d3){var _0x117899;if(typeof _0x23ec98!=='string'||_0x23ec98[_0x226c('0x1')]===0x0){return _0x2f79d3(_0x226c('0x2'));}if(typeof _0x674a14!==_0x226c('0x3')||_0x674a14[_0x226c('0x1')]===0x0){return _0x2f79d3(_0x226c('0x4'));}if(typeof _0x3b56e8!=='undefined'&&(typeof _0x3b56e8!==_0x226c('0x3')||_0x3b56e8[_0x226c('0x1')]===0x0)){return _0x2f79d3(_0x226c('0x5'));}try{_0x117899=fs[_0x226c('0x6')](_0x23ec98)[_0x226c('0x7')]('base64');}catch(_0x16cbbd){return _0x2f79d3(_0x16cbbd);}return _0x5e55b3({'method':_0x226c('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x674a14,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x226c('0x9'),'languageCode':_0x3b56e8},'audio':{'content':_0x117899}},'json':!![]});});};
\ No newline at end of file