#[cfg(feature = "vad")]
mod processor;
#[cfg(not(feature = "vad"))]
mod processor_noop;
#[cfg(feature = "vad")]
pub use processor::{VadProcessor, VadState};
#[cfg(not(feature = "vad"))]
pub use processor_noop::{VadProcessor, VadState};
#[derive(Debug, Clone, Copy)]
pub struct VadConfig {
pub enabled: bool,
pub threshold: f32,
}
impl Default for VadConfig {
fn default() -> Self {
Self {
enabled: false,
threshold: 0.5,
}
}
}
impl VadConfig {
pub fn new(enabled: bool, threshold: f32) -> Self {
Self { enabled, threshold }
}
pub fn disabled() -> Self {
Self {
enabled: false,
threshold: 0.5,
}
}
pub fn enabled_with_threshold(threshold: f32) -> Self {
Self {
enabled: true,
threshold,
}
}
}