Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / services / agi / scripts / google / asr / lib / api.js
index b9a1361..df52eb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0506=['/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','filepath\x20should\x20be\x20a\x20string','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','POST'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0x0506,0x1d1));var _0x6050=function(_0x5d7798,_0x227be6){_0x5d7798=_0x5d7798-0x0;var _0x2a586b=_0x0506[_0x5d7798];return _0x2a586b;};'use strict';var url=require(_0x6050('0x0'));var BPromise=require(_0x6050('0x1'));var fs=require('fs');var host=_0x6050('0x2');module['exports']=function(_0x52f82b,_0x5139c7,_0x49a1ca){return new BPromise(function(_0x229b5f,_0x58e2a9){var _0x3cbb1f;if(typeof _0x52f82b!=='string'||_0x52f82b['length']===0x0){return _0x58e2a9(_0x6050('0x3'));}if(typeof _0x5139c7!==_0x6050('0x4')||_0x5139c7[_0x6050('0x5')]===0x0){return _0x58e2a9(_0x6050('0x6'));}if(typeof _0x49a1ca!==_0x6050('0x7')&&(typeof _0x49a1ca!==_0x6050('0x4')||_0x49a1ca[_0x6050('0x5')]===0x0)){return _0x58e2a9(_0x6050('0x8'));}try{_0x3cbb1f=fs['readFileSync'](_0x52f82b)[_0x6050('0x9')]('base64');}catch(_0x15ad99){return _0x58e2a9(_0x15ad99);}return _0x229b5f({'method':_0x6050('0xa'),'uri':host+_0x6050('0xb')+_0x5139c7,'body':{'config':{'encoding':_0x6050('0xc'),'sampleRateHertz':_0x6050('0xd'),'languageCode':_0x49a1ca},'audio':{'content':_0x3cbb1f}},'json':!![]});});};
\ No newline at end of file
+var _0x7794=['string','length','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports'];(function(_0x3cfc99,_0x34f09c){var _0x13cdba=function(_0x5813e6){while(--_0x5813e6){_0x3cfc99['push'](_0x3cfc99['shift']());}};_0x13cdba(++_0x34f09c);}(_0x7794,0x7b));var _0x4779=function(_0x5cda6e,_0x4140bc){_0x5cda6e=_0x5cda6e-0x0;var _0x41d8b0=_0x7794[_0x5cda6e];return _0x41d8b0;};'use strict';var url=require('url');var BPromise=require(_0x4779('0x0'));var fs=require('fs');var host=_0x4779('0x1');module[_0x4779('0x2')]=function(_0xa47992,_0x493318,_0x309b79){return new BPromise(function(_0x1e9fdc,_0x4d3b05){var _0x40e5f9;if(typeof _0xa47992!=='string'||_0xa47992['length']===0x0){return _0x4d3b05('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x493318!==_0x4779('0x3')||_0x493318[_0x4779('0x4')]===0x0){return _0x4d3b05('key\x20should\x20be\x20a\x20string');}if(typeof _0x309b79!==_0x4779('0x5')&&(typeof _0x309b79!==_0x4779('0x3')||_0x309b79[_0x4779('0x4')]===0x0)){return _0x4d3b05(_0x4779('0x6'));}try{_0x40e5f9=fs[_0x4779('0x7')](_0xa47992)[_0x4779('0x8')](_0x4779('0x9'));}catch(_0x5e4992){return _0x4d3b05(_0x5e4992);}return _0x1e9fdc({'method':_0x4779('0xa'),'uri':host+_0x4779('0xb')+_0x493318,'body':{'config':{'encoding':_0x4779('0xc'),'sampleRateHertz':_0x4779('0xd'),'languageCode':_0x309b79},'audio':{'content':_0x40e5f9}},'json':!![]});});};
\ No newline at end of file