From c5fcb125c607e644b1deec5abb4367d50e7e22b2 Mon Sep 17 00:00:00 2001 From: Liam Warfield Date: Mon, 19 Jan 2026 14:50:31 -0700 Subject: [PATCH] Fix bug with buffer clearing. --- gui/src/effects.rs | 2 +- gui/src/imp/web.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/src/effects.rs b/gui/src/effects.rs index b8b47d3..ef87bcd 100644 --- a/gui/src/effects.rs +++ b/gui/src/effects.rs @@ -11,7 +11,7 @@ use crate::imp; static DF_MODEL: Asset = asset!("/assets/DeepFilterNet3_ll_onnx.tar.gz"); // TODO: make this user configurable. -static DEFAULT_NOISE_FLOOR: f32 = 0.007; +static DEFAULT_NOISE_FLOOR: f32 = 0.001; // 200ms hold at 48kHz sample rate static HOLD_SAMPLES_MAX: usize = 48000 / 5; // 9600 samples = 200ms diff --git a/gui/src/imp/web.rs b/gui/src/imp/web.rs index a829311..4a6339c 100644 --- a/gui/src/imp/web.rs +++ b/gui/src/imp/web.rs @@ -237,7 +237,9 @@ fn process_audio(frame: &JsValue, processor: &mut AudioProcessor) -> TransmitSta let input = samples.to_vec(); let mut output = Vec::with_capacity(input.len()); let state = processor.process(&input, 1, &mut output); - samples.copy_from(&output); + if !output.is_empty() { + samples.copy_from(&output); + } state }