Struct VadConfig
pub struct VadConfig {
pub sample_rate: u32,
pub frame_duration_ms: u32,
pub start_threshold_db: f64,
pub stop_threshold_db: f64,
pub min_speech_frames: u32,
pub hangover_frames: u32,
pub speech_zcr_range: (f64, f64),
pub initial_noise_floor_db: f64,
pub pre_speech_frames: usize,
}Expand description
VAD configuration parameters.
Fields§
§sample_rate: u32Sample rate in Hz.
frame_duration_ms: u32Frame duration in milliseconds (typically 10–30ms).
start_threshold_db: f64Energy threshold (dBFS) above noise floor to trigger speech start.
stop_threshold_db: f64Energy threshold (dBFS) above noise floor to end speech.
min_speech_frames: u32Minimum speech duration in frames before confirming speech.
hangover_frames: u32Hangover duration in frames — keeps “speaking” state after energy drops.
speech_zcr_range: (f64, f64)ZCR range for speech confirmation (low, high).
initial_noise_floor_db: f64Initial noise floor estimate (dBFS).
pre_speech_frames: usizeNumber of pre-speech frames to buffer.
Implementations§
§impl VadConfig
impl VadConfig
pub fn frame_size(&self) -> usize
pub fn frame_size(&self) -> usize
Number of samples per frame.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VadConfig
impl RefUnwindSafe for VadConfig
impl Send for VadConfig
impl Sync for VadConfig
impl Unpin for VadConfig
impl UnwindSafe for VadConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more