fix(rms_vad): correct types and threshold order in flush idempotency test
Two issues in flush_is_idempotent_and_leaves_clean_state from
581a098:
1. silence_close_samples and max_chunk_samples were cast `as u64`
but with_thresholds takes usize — wouldn't compile.
2. enter_threshold was 0.005 and exit_threshold 0.01, which
violates the hysteresis invariant (enter must be >= exit) and
panics in debug_assert at runtime. Swap to 0.01 / 0.005 so the
test actually runs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -700,11 +700,11 @@ mod tests {
|
|||||||
// silence emits nothing (i.e. no stale onset / silent_tail
|
// silence emits nothing (i.e. no stale onset / silent_tail
|
||||||
// bookkeeping leaks into the next feed).
|
// bookkeeping leaks into the next feed).
|
||||||
let mut c = RmsVadChunker::with_thresholds(
|
let mut c = RmsVadChunker::with_thresholds(
|
||||||
0.005,
|
|
||||||
0.01,
|
0.01,
|
||||||
|
0.005,
|
||||||
DEFAULT_SPEECH_ONSET_FRAMES,
|
DEFAULT_SPEECH_ONSET_FRAMES,
|
||||||
(FRAME_SAMPLES * 4) as u64,
|
FRAME_SAMPLES * 4,
|
||||||
(FRAME_SAMPLES * 50) as u64,
|
FRAME_SAMPLES * 50,
|
||||||
);
|
);
|
||||||
|
|
||||||
let speech = constant_signal(FRAME_SAMPLES * 6, 0.02);
|
let speech = constant_signal(FRAME_SAMPLES * 6, 0.02);
|
||||||
|
|||||||
Reference in New Issue
Block a user