Built motion from commit 91ed41ac.|2.5.44
[motion2.git] / server / services / agi / scripts / google / asr / lib / api.js
index 1fa526e..9c79e3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87f8=['length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST','/v1/speech:recognize?key=','LINEAR16','exports','string'];(function(_0x450b2a,_0x174591){var _0x37a7ff=function(_0x259a26){while(--_0x259a26){_0x450b2a['push'](_0x450b2a['shift']());}};_0x37a7ff(++_0x174591);}(_0x87f8,0x152));var _0x887f=function(_0x53fe05,_0x17c66b){_0x53fe05=_0x53fe05-0x0;var _0x1b1e2d=_0x87f8[_0x53fe05];return _0x1b1e2d;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module[_0x887f('0x0')]=function(_0x13309f,_0x5be12b,_0x28ce3c){return new BPromise(function(_0x591ca0,_0x46a51e){var _0x3ce88c;if(typeof _0x13309f!==_0x887f('0x1')||_0x13309f[_0x887f('0x2')]===0x0){return _0x46a51e('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x5be12b!==_0x887f('0x1')||_0x5be12b[_0x887f('0x2')]===0x0){return _0x46a51e(_0x887f('0x3'));}if(typeof _0x28ce3c!==_0x887f('0x4')&&(typeof _0x28ce3c!==_0x887f('0x1')||_0x28ce3c[_0x887f('0x2')]===0x0)){return _0x46a51e(_0x887f('0x5'));}try{_0x3ce88c=fs['readFileSync'](_0x13309f)[_0x887f('0x6')]('base64');}catch(_0x130293){return _0x46a51e(_0x130293);}return _0x591ca0({'method':_0x887f('0x7'),'uri':host+_0x887f('0x8')+_0x5be12b,'body':{'config':{'encoding':_0x887f('0x9'),'sampleRateHertz':'8000','languageCode':_0x28ce3c},'audio':{'content':_0x3ce88c}},'json':!![]});});};
\ No newline at end of file
+var _0x0624=['length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','filepath\x20should\x20be\x20a\x20string','string'];(function(_0xc68927,_0x2937e6){var _0x584501=function(_0x32209f){while(--_0x32209f){_0xc68927['push'](_0xc68927['shift']());}};_0x584501(++_0x2937e6);}(_0x0624,0x132));var _0x4062=function(_0x8e379,_0x20174d){_0x8e379=_0x8e379-0x0;var _0x37bab3=_0x0624[_0x8e379];return _0x37bab3;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x2d6840,_0x144406,_0x106cf5){return new BPromise(function(_0x3b4af5,_0x29add8){var _0x5d143e;if(typeof _0x2d6840!=='string'||_0x2d6840['length']===0x0){return _0x29add8(_0x4062('0x0'));}if(typeof _0x144406!==_0x4062('0x1')||_0x144406[_0x4062('0x2')]===0x0){return _0x29add8(_0x4062('0x3'));}if(typeof _0x106cf5!==_0x4062('0x4')&&(typeof _0x106cf5!=='string'||_0x106cf5[_0x4062('0x2')]===0x0)){return _0x29add8('lang\x20should\x20be\x20a\x20string');}try{_0x5d143e=fs[_0x4062('0x5')](_0x2d6840)[_0x4062('0x6')](_0x4062('0x7'));}catch(_0x5343e6){return _0x29add8(_0x5343e6);}return _0x3b4af5({'method':_0x4062('0x8'),'uri':host+_0x4062('0x9')+_0x144406,'body':{'config':{'encoding':_0x4062('0xa'),'sampleRateHertz':'8000','languageCode':_0x106cf5},'audio':{'content':_0x5d143e}},'json':!![]});});};
\ No newline at end of file