function error(e, msg) { out.error(argv.debug ? e : msg); process.exit(1); }
function debugLog(message) { if (argv.debug) { console.log(message.blue) } }
function startMicInstance() { debug("startMicInstance"); var micInstance = mic({ device: argv.mic || 'default', channels: 1, rate: '16000', // the decoder expects 16000, do not modify debug: Boolean(argv.debug) || false, exitOnSilence: 6 }); var micInputStream = micInstance.getAudioStream(); outputFileStream = fs.WriteStream(`${path.resolve(__dirname)}/../resources/output.wav`); micInputStream.pipe(outputFileStream); bindListeners(micInputStream, micInstance, outputFileStream); micInstance.start(); }
init() { this._app = this._modElectron.app; this._app.on('window-all-closed', () => { if (process.platform !== 'darwin') { this._app.quit(); } }); this._app.on('ready', () => { let windowsize = this._args.windowsize.split('x'); this._mainWindow = new this._modElectron.BrowserWindow({ width: parseInt(windowsize[0]), height: parseInt(windowsize[1]) }); let mainHtml = this._modPath.join(__dirname, this._mainHtmlFile); this._mainWindow.loadURL('file://' + mainHtml); if (this._args.debug) { this._mainWindow.webContents.openDevTools(); } this._modBlock.block(this._mainWindow, __dirname + '/cfg/block/block.yml'); this._mainWindow.on('closed', () => { this._mainWindow = null; }); }); }
if (argv.debug) {devices[id].log.enabled = true;}
if (!argv.quiet && !argv.silent && !argv.debug) { sf.onRequest(async ({ req, res }, next) => { console.log(`\t ${req.method} \t\t ${req.url}`)
if(!argv.debug && !response.matchedKey){ return null;
function respond(data) { var str = JSON.stringify(data); if (typeof(argv.debug)!=='undefined' && argv.debug==='true') console.log("S:" + str); ws.send(str); if (typeof(argv.debug)!=='undefined' && argv.debug==='true') console.log("C:" + cmd); if (typeof(argv.debug)!=='undefined' && argv.debug==='true') console.log("C:" + call); eval(call);