Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / services / agi / scripts / google / asr / lib / api.js
index 14f983d..17eb6aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd04c=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','string'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xd04c,0xc4));var _0xcd04=function(_0x5a683d,_0x1eecea){_0x5a683d=_0x5a683d-0x0;var _0x4fd94a=_0xd04c[_0x5a683d];return _0x4fd94a;};'use strict';var url=require('url');var BPromise=require(_0xcd04('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x3e63dd,_0x21af30,_0x45919b){return new BPromise(function(_0xc93adf,_0x17524f){var _0x583bd1;if(typeof _0x3e63dd!==_0xcd04('0x1')||_0x3e63dd[_0xcd04('0x2')]===0x0){return _0x17524f(_0xcd04('0x3'));}if(typeof _0x21af30!==_0xcd04('0x1')||_0x21af30[_0xcd04('0x2')]===0x0){return _0x17524f(_0xcd04('0x4'));}if(typeof _0x45919b!=='undefined'&&(typeof _0x45919b!=='string'||_0x45919b[_0xcd04('0x2')]===0x0)){return _0x17524f('lang\x20should\x20be\x20a\x20string');}try{_0x583bd1=fs['readFileSync'](_0x3e63dd)[_0xcd04('0x5')](_0xcd04('0x6'));}catch(_0x353bd7){return _0x17524f(_0x353bd7);}return _0xc93adf({'method':_0xcd04('0x7'),'uri':host+_0xcd04('0x8')+_0x21af30,'body':{'config':{'encoding':_0xcd04('0x9'),'sampleRateHertz':_0xcd04('0xa'),'languageCode':_0x45919b},'audio':{'content':_0x583bd1}},'json':!![]});});};
\ No newline at end of file
+var _0x01f5=['LINEAR16','8000','url','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST'];(function(_0x2b9061,_0x1af183){var _0x3e661c=function(_0x288e9d){while(--_0x288e9d){_0x2b9061['push'](_0x2b9061['shift']());}};_0x3e661c(++_0x1af183);}(_0x01f5,0x64));var _0x501f=function(_0x31088e,_0x5e7aed){_0x31088e=_0x31088e-0x0;var _0x18486b=_0x01f5[_0x31088e];return _0x18486b;};'use strict';var url=require(_0x501f('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x501f('0x1');module[_0x501f('0x2')]=function(_0x20c04c,_0x3179b4,_0x2be00b){return new BPromise(function(_0x563f37,_0xd8c776){var _0x24e5d9;if(typeof _0x20c04c!==_0x501f('0x3')||_0x20c04c[_0x501f('0x4')]===0x0){return _0xd8c776(_0x501f('0x5'));}if(typeof _0x3179b4!==_0x501f('0x3')||_0x3179b4['length']===0x0){return _0xd8c776(_0x501f('0x6'));}if(typeof _0x2be00b!==_0x501f('0x7')&&(typeof _0x2be00b!==_0x501f('0x3')||_0x2be00b['length']===0x0)){return _0xd8c776(_0x501f('0x8'));}try{_0x24e5d9=fs['readFileSync'](_0x20c04c)[_0x501f('0x9')](_0x501f('0xa'));}catch(_0x129f41){return _0xd8c776(_0x129f41);}return _0x563f37({'method':_0x501f('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x3179b4,'body':{'config':{'encoding':_0x501f('0xc'),'sampleRateHertz':_0x501f('0xd'),'languageCode':_0x2be00b},'audio':{'content':_0x24e5d9}},'json':!![]});});};
\ No newline at end of file