pub struct VadConfig {
pub enabled: bool,
pub sensitivity: f32,
pub chunk_size: usize,
pub sample_rate: u32,
pub padding_chunks: u32,
pub min_speech_duration_ms: u32,
pub speech_merge_gap_ms: u32,
}Expand description
Local Voice Activity Detection configuration.
Defines parameters for local VAD processing, including sensitivity settings, audio processing parameters, and speech detection behavior.
Fields§
§enabled: boolWhether to enable local VAD method
sensitivity: f32Speech detection sensitivity (0.0-1.0)
chunk_size: usizeAudio chunk size in samples
sample_rate: u32Processing sample rate in Hz
padding_chunks: u32Padding chunks before and after speech detection
min_speech_duration_ms: u32Minimum speech duration in milliseconds
speech_merge_gap_ms: u32Speech segment merge gap in milliseconds
Implementations§
Source§impl VadConfig
impl VadConfig
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the local VAD configuration for correctness.
Ensures that all VAD-related parameters are within acceptable ranges and have valid values for audio processing.
§Returns
Returns Ok(()) if validation passes, or an error describing
the validation failure.
§Errors
This function returns an error if:
sensitivityis outside the valid range (0.0-1.0)chunk_sizeis not a power of 2 or outside valid rangesample_rateis not one of the supported rates
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VadConfig
impl<'de> Deserialize<'de> for VadConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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