Built motion from commit (unavailable).|2.2.0
[motion2.git] / server / services / agi / scripts / google / asr / lib / api.js
index 98b2911..5e5f393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f9d=['length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string'];(function(_0x245efb,_0x2c636b){var _0x59ee7b=function(_0x3953f8){while(--_0x3953f8){_0x245efb['push'](_0x245efb['shift']());}};_0x59ee7b(++_0x2c636b);}(_0x1f9d,0xfa));var _0xd1f9=function(_0x1c979b,_0x3e246d){_0x1c979b=_0x1c979b-0x0;var _0x142b09=_0x1f9d[_0x1c979b];return _0x142b09;};'use strict';var url=require(_0xd1f9('0x0'));var BPromise=require(_0xd1f9('0x1'));var fs=require('fs');var host=_0xd1f9('0x2');module[_0xd1f9('0x3')]=function(_0x568564,_0xe0a20c,_0x423b2f){return new BPromise(function(_0x16ea0,_0x30c851){var _0xd0c97c;if(typeof _0x568564!==_0xd1f9('0x4')||_0x568564['length']===0x0){return _0x30c851(_0xd1f9('0x5'));}if(typeof _0xe0a20c!==_0xd1f9('0x4')||_0xe0a20c[_0xd1f9('0x6')]===0x0){return _0x30c851(_0xd1f9('0x7'));}if(typeof _0x423b2f!==_0xd1f9('0x8')&&(typeof _0x423b2f!==_0xd1f9('0x4')||_0x423b2f[_0xd1f9('0x6')]===0x0)){return _0x30c851(_0xd1f9('0x9'));}try{_0xd0c97c=fs[_0xd1f9('0xa')](_0x568564)[_0xd1f9('0xb')](_0xd1f9('0xc'));}catch(_0x578d4d){return _0x30c851(_0x578d4d);}return _0x16ea0({'method':_0xd1f9('0xd'),'uri':host+'/v1/speech:recognize?key='+_0xe0a20c,'body':{'config':{'encoding':_0xd1f9('0xe'),'sampleRateHertz':_0xd1f9('0xf'),'languageCode':_0x423b2f},'audio':{'content':_0xd0c97c}},'json':!![]});});};
\ No newline at end of file
+var _0x2821=['length','filepath\x20should\x20be\x20a\x20string','string','undefined','readFileSync','base64','LINEAR16','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0x2821,0x147));var _0x1282=function(_0x556f6c,_0x2e4d09){_0x556f6c=_0x556f6c-0x0;var _0xf637b2=_0x2821[_0x556f6c];return _0xf637b2;};'use strict';var url=require(_0x1282('0x0'));var BPromise=require(_0x1282('0x1'));var fs=require('fs');var host=_0x1282('0x2');module['exports']=function(_0x3b758c,_0x369f86,_0x10277c){return new BPromise(function(_0x33a540,_0x1370d4){var _0x9f5151;if(typeof _0x3b758c!=='string'||_0x3b758c[_0x1282('0x3')]===0x0){return _0x1370d4(_0x1282('0x4'));}if(typeof _0x369f86!==_0x1282('0x5')||_0x369f86[_0x1282('0x3')]===0x0){return _0x1370d4('key\x20should\x20be\x20a\x20string');}if(typeof _0x10277c!==_0x1282('0x6')&&(typeof _0x10277c!==_0x1282('0x5')||_0x10277c[_0x1282('0x3')]===0x0)){return _0x1370d4('lang\x20should\x20be\x20a\x20string');}try{_0x9f5151=fs[_0x1282('0x7')](_0x3b758c)['toString'](_0x1282('0x8'));}catch(_0x1b1518){return _0x1370d4(_0x1b1518);}return _0x33a540({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x369f86,'body':{'config':{'encoding':_0x1282('0x9'),'sampleRateHertz':_0x1282('0xa'),'languageCode':_0x10277c},'audio':{'content':_0x9f5151}},'json':!![]});});};
\ No newline at end of file