Add a default noise floor. #13

Merged
liamwarfield merged 5 commits from feature/stop-sending-when-quiet into main 2026-01-19 22:07:06 +00:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit c5fcb125c6 - Show all commits
+1 -1
View File
@@ -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
+3 -1
View File
@@ -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
}
2