From 7d509eeb487b0c8e420fee2c877740e89c46ac95 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Fri, 11 Sep 2020 00:19:04 +0200 Subject: [PATCH] explicitly fill buffer with 0s to avoid noise on newer chrome versions --- htdocs/lib/AudioProcessor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/lib/AudioProcessor.js b/htdocs/lib/AudioProcessor.js index 7ac76c5..a3e9abf 100644 --- a/htdocs/lib/AudioProcessor.js +++ b/htdocs/lib/AudioProcessor.js @@ -33,7 +33,10 @@ class OwrxAudioProcessor extends AudioWorkletProcessor { this.port.start(); } process(inputs, outputs) { - if (this.remaining() < 128) return true; + if (this.remaining() < 128) { + outputs[0].forEach(output => output.fill(0)); + return true; + } outputs[0].forEach((output) => { output.set(this.audioBuffer.subarray(this.outPos, this.outPos + 128)); });