diff --git a/client/actions.js b/client/actions.js index 5509464..0f9960d 100644 --- a/client/actions.js +++ b/client/actions.js @@ -68,7 +68,7 @@ Actions.registerLogger = function(process, log) { // Starts a process and handles general errors Actions.spawnProcess = function(name, command, args) { let process = child_process.spawn(command, args); - LOG.info(`spawned ${name} ${process.pid}`); + LOG.info(`spawned ${name} ${process.pid}`, { name: name, command: command, args: args }); process.on('close', (code, signal) => { LOG.silly(`${name} ${process.pid} closed, code: ${code}, signal: ${signal}`); }); @@ -90,7 +90,9 @@ Actions.spawnProcess = function(name, command, args) { * @returns the child process that was spawned */ Actions.startRecording = function(song) { - let device = 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'; + // pacmd list-sinks + //let device = 'alsa_output.pci-0000_00_1f.3.analog-stereo.monitor'; + let device = 'alsa_output.pci-0000_00_1b.0.analog-stereo.monitor'; let output = '../intermediate/' + song.guid + '.wav'; // -v for verbose output let recording_process = Actions.spawnProcess( diff --git a/client/main.js b/client/main.js index 5a0a2a6..3d5ac56 100644 --- a/client/main.js +++ b/client/main.js @@ -1,4 +1,4 @@ -const electron = require('electron'); +const electron = require('electron').remote; const http = require('http'); const Actions = require('./actions.js'); @@ -56,13 +56,13 @@ async function stopRecordingStartConversion() { LOG.debug(`${conversionSong.filename} starting conversion...`); let conversionProcess = Actions.convertToMp3(conversionSong); Actions.registerLogger(conversionProcess, CVRTLOG); - conversionProcess.on('exit', (code, signal) => { + conversionProcess.on('close', (code, signal) => { LOG.info(`${conversionSong.filename} completed conversion`); LOG.debug(`${conversionSong.filename} starting adding metadata...`); let metadataProcess = Actions.addMetadata(conversionSong); Actions.registerLogger(metadataProcess, METALOG); - metadataProcess.on('exit', (code, signal) => { + metadataProcess.on('close', (code, signal) => { LOG.info(`${conversionSong.filename} completed adding metadata`); Actions.removeIntermediate(conversionSong); }); diff --git a/logger/logger.js b/logger/logger.js old mode 100755 new mode 100644 diff --git a/logger/package.json b/logger/package.json old mode 100755 new mode 100644