1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0x4133=['8000','bluebird','exports','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0x4133,0xf1));var _0x3413=function(_0x272a46,_0x12b300){_0x272a46=_0x272a46-0x0;var _0x2bfd12=_0x4133[_0x272a46];return _0x2bfd12;};'use strict';var url=require('url');var BPromise=require(_0x3413('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x3413('0x1')]=function(_0x1b5540,_0x10af5b,_0x140ff){return new BPromise(function(_0x439688,_0x25ad08){var _0xd554d6;if(typeof _0x1b5540!==_0x3413('0x2')||_0x1b5540[_0x3413('0x3')]===0x0){return _0x25ad08('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x10af5b!=='string'||_0x10af5b[_0x3413('0x3')]===0x0){return _0x25ad08(_0x3413('0x4'));}if(typeof _0x140ff!=='undefined'&&(typeof _0x140ff!==_0x3413('0x2')||_0x140ff[_0x3413('0x3')]===0x0)){return _0x25ad08(_0x3413('0x5'));}try{_0xd554d6=fs[_0x3413('0x6')](_0x1b5540)[_0x3413('0x7')]('base64');}catch(_0xf37e8e){return _0x25ad08(_0xf37e8e);}return _0x439688({'method':_0x3413('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x10af5b,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x3413('0x9'),'languageCode':_0x140ff},'audio':{'content':_0xd554d6}},'json':!![]});});};