extended config to allow specification of the audio server port / listen address (needed for docker)

This commit is contained in:
Daniel Sommer 2022-05-06 14:33:05 +02:00
parent 16c5cd8948
commit 1c423ae988
3 changed files with 7 additions and 3 deletions

View file

@ -5,8 +5,8 @@ const PCMStream = require('./PCMStream.js');
class AudioServer { class AudioServer {
constructor(file, progress) { constructor(file, progress) {
this.listen = config?.server?.listen || '0.0.0.0'; this.listen = config?.audio?.listen || '0.0.0.0';
this.port = 0; this.port = config?.audio?.port;
this.file = file; this.file = file;
this.clients = []; this.clients = [];
this.sockets = []; this.sockets = [];

View file

@ -107,7 +107,9 @@ class PCMStream extends EventEmitter {
try { try {
await unlink(fifo); await unlink(fifo);
} catch (error) { } catch (error) {
logger.debug('theres no fifo file to delete...'); if (error.code !== 'ENOENT') {
logger.error('encountered an error deleting the fifo file \'' + fifo + '\': ' + error);
}
} }
this.fifo.process = spawn('mkfifo', [fifo]); this.fifo.process = spawn('mkfifo', [fifo]);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

View file

@ -27,6 +27,8 @@
"password": "kannon" "password": "kannon"
}, },
"audio": { "audio": {
"listen": "0.0.0.0",
"port": 3001,
"nodelay": false, "nodelay": false,
"threshold": 8 "threshold": 8
} }