Built motion from commit (unavailable).|2.3.96
[motion2.git] / server / services / agi / scripts / google / asr / lib / api.js
index 41d33ee..72d4cdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27eb=['url','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000'];(function(_0x4db547,_0x19eef3){var _0x1654f8=function(_0x3fac47){while(--_0x3fac47){_0x4db547['push'](_0x4db547['shift']());}};_0x1654f8(++_0x19eef3);}(_0x27eb,0x1ee));var _0xb27e=function(_0xb0b610,_0x262078){_0xb0b610=_0xb0b610-0x0;var _0x4866e4=_0x27eb[_0xb0b610];return _0x4866e4;};'use strict';var url=require(_0xb27e('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xb27e('0x1');module['exports']=function(_0x4cb149,_0x275dc2,_0x4a9ac2){return new BPromise(function(_0x583708,_0x28c80b){var _0x2c7d9e;if(typeof _0x4cb149!==_0xb27e('0x2')||_0x4cb149['length']===0x0){return _0x28c80b('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x275dc2!==_0xb27e('0x2')||_0x275dc2[_0xb27e('0x3')]===0x0){return _0x28c80b(_0xb27e('0x4'));}if(typeof _0x4a9ac2!==_0xb27e('0x5')&&(typeof _0x4a9ac2!==_0xb27e('0x2')||_0x4a9ac2[_0xb27e('0x3')]===0x0)){return _0x28c80b('lang\x20should\x20be\x20a\x20string');}try{_0x2c7d9e=fs[_0xb27e('0x6')](_0x4cb149)[_0xb27e('0x7')](_0xb27e('0x8'));}catch(_0x34508a){return _0x28c80b(_0x34508a);}return _0x583708({'method':_0xb27e('0x9'),'uri':host+_0xb27e('0xa')+_0x275dc2,'body':{'config':{'encoding':_0xb27e('0xb'),'sampleRateHertz':_0xb27e('0xc'),'languageCode':_0x4a9ac2},'audio':{'content':_0x2c7d9e}},'json':!![]});});};
\ No newline at end of file
+var _0x95ad=['/v1/speech:recognize?key=','8000','url','bluebird','exports','filepath\x20should\x20be\x20a\x20string','string','length','lang\x20should\x20be\x20a\x20string','readFileSync','POST'];(function(_0x47a607,_0x4e64cb){var _0x417055=function(_0x4b72bf){while(--_0x4b72bf){_0x47a607['push'](_0x47a607['shift']());}};_0x417055(++_0x4e64cb);}(_0x95ad,0x70));var _0xd95a=function(_0x4b5699,_0x1b51af){_0x4b5699=_0x4b5699-0x0;var _0x4654b1=_0x95ad[_0x4b5699];return _0x4654b1;};'use strict';var url=require(_0xd95a('0x0'));var BPromise=require(_0xd95a('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xd95a('0x2')]=function(_0xf725ad,_0x261dd7,_0x25285b){return new BPromise(function(_0x1e53cd,_0x102e96){var _0x280a76;if(typeof _0xf725ad!=='string'||_0xf725ad['length']===0x0){return _0x102e96(_0xd95a('0x3'));}if(typeof _0x261dd7!==_0xd95a('0x4')||_0x261dd7[_0xd95a('0x5')]===0x0){return _0x102e96('key\x20should\x20be\x20a\x20string');}if(typeof _0x25285b!=='undefined'&&(typeof _0x25285b!==_0xd95a('0x4')||_0x25285b[_0xd95a('0x5')]===0x0)){return _0x102e96(_0xd95a('0x6'));}try{_0x280a76=fs[_0xd95a('0x7')](_0xf725ad)['toString']('base64');}catch(_0x179b2b){return _0x102e96(_0x179b2b);}return _0x1e53cd({'method':_0xd95a('0x8'),'uri':host+_0xd95a('0x9')+_0x261dd7,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xd95a('0xa'),'languageCode':_0x25285b},'audio':{'content':_0x280a76}},'json':!![]});});};
\ No newline at end of file