Fix buffering silence issue.
This fixes a bug where we were still appending silence to the output buffer while not transmitting.
This commit is contained in:
+2
-1
@@ -11,7 +11,7 @@ use crate::imp;
|
|||||||
|
|
||||||
static DF_MODEL: Asset = asset!("/assets/DeepFilterNet3_ll_onnx.tar.gz");
|
static DF_MODEL: Asset = asset!("/assets/DeepFilterNet3_ll_onnx.tar.gz");
|
||||||
// TODO: make this user configurable.
|
// TODO: make this user configurable.
|
||||||
static DEFAULT_NOISE_FLOOR: f32 = 0.0007;
|
static DEFAULT_NOISE_FLOOR: f32 = 0.007;
|
||||||
// 200ms hold at 48kHz sample rate
|
// 200ms hold at 48kHz sample rate
|
||||||
static HOLD_SAMPLES_MAX: usize = 48000 / 5; // 9600 samples = 200ms
|
static HOLD_SAMPLES_MAX: usize = 48000 / 5; // 9600 samples = 200ms
|
||||||
|
|
||||||
@@ -185,6 +185,7 @@ impl AudioProcessor {
|
|||||||
TransmitState::Terminator
|
TransmitState::Terminator
|
||||||
} else {
|
} else {
|
||||||
// Not transmitting and below threshold - stay silent
|
// Not transmitting and below threshold - stay silent
|
||||||
|
output.clear(); // Don't accumulate stale audio during silence
|
||||||
TransmitState::Silent
|
TransmitState::Silent
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user