extended config to allow specification of the audio server port / listen address (needed for docker)
This commit is contained in:
parent
16c5cd8948
commit
1c423ae988
3 changed files with 7 additions and 3 deletions
|
@ -5,8 +5,8 @@ const PCMStream = require('./PCMStream.js');
|
|||
class AudioServer {
|
||||
|
||||
constructor(file, progress) {
|
||||
this.listen = config?.server?.listen || '0.0.0.0';
|
||||
this.port = 0;
|
||||
this.listen = config?.audio?.listen || '0.0.0.0';
|
||||
this.port = config?.audio?.port;
|
||||
this.file = file;
|
||||
this.clients = [];
|
||||
this.sockets = [];
|
||||
|
|
|
@ -107,7 +107,9 @@ class PCMStream extends EventEmitter {
|
|||
try {
|
||||
await unlink(fifo);
|
||||
} 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]);
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
"password": "kannon"
|
||||
},
|
||||
"audio": {
|
||||
"listen": "0.0.0.0",
|
||||
"port": 3001,
|
||||
"nodelay": false,
|
||||
"threshold": 8
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue