fixed threshold calculation
This commit is contained in:
parent
365f8b147b
commit
e3a30f9396
1 changed files with 5 additions and 1 deletions
|
@ -46,7 +46,11 @@ class AudioServer {
|
||||||
});
|
});
|
||||||
const stats = await stat(this.buffer.file);
|
const stats = await stat(this.buffer.file);
|
||||||
this.buffer.size = stats.size;
|
this.buffer.size = stats.size;
|
||||||
this.buffer.threshold = (this.buffer.size / 100) / (!isNaN(config.audio?.threshold) || 30);
|
let divisor = 30;
|
||||||
|
if (!(isNaN(config.audio?.threshold))) {
|
||||||
|
divisor = config.audio.threshold;
|
||||||
|
}
|
||||||
|
this.buffer.threshold = (this.buffer.size / 100) / divisor;
|
||||||
this.#announceAudioServer();
|
this.#announceAudioServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue