mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-01-03 15:20:27 +01:00
don't split ringbuffer blocks in the output; this means up to 3ms stay
in the buffer.
This commit is contained in:
parent
dd7d262bd3
commit
7ef0ef0d7c
|
|
@ -32,11 +32,11 @@ class OwrxAudioProcessor extends AudioWorkletProcessor {
|
|||
this.port.start();
|
||||
}
|
||||
process(inputs, outputs) {
|
||||
const samples = Math.min(128, this.remaining());
|
||||
if (this.remaining() < 128) return true;
|
||||
outputs[0].forEach((output) => {
|
||||
output.set(this.audioBuffer.subarray(this.outPos, this.outPos + samples));
|
||||
output.set(this.audioBuffer.subarray(this.outPos, this.outPos + 128));
|
||||
});
|
||||
this.outPos = (this.outPos + samples) % this.bufferSize;
|
||||
this.outPos = (this.outPos + 128) % this.bufferSize;
|
||||
return true;
|
||||
}
|
||||
remaining() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue