Struct VoiceActivityDetector
pub struct VoiceActivityDetector { /* private fields */ }Expand description
Voice Activity Detector with adaptive noise floor.
Implementations§
§impl VoiceActivityDetector
impl VoiceActivityDetector
pub fn new(config: VadConfig) -> VoiceActivityDetector
pub fn new(config: VadConfig) -> VoiceActivityDetector
Create a new VAD with the given configuration.
pub fn state(&self) -> VadState
pub fn state(&self) -> VadState
Current VAD state.
pub fn is_speaking(&self) -> bool
pub fn is_speaking(&self) -> bool
Whether speech is currently detected (Speech or Hangover state).
pub fn noise_floor_db(&self) -> f64
pub fn noise_floor_db(&self) -> f64
Current noise floor estimate (dBFS).
pub fn is_wavekat_backed(&self) -> bool
pub fn is_wavekat_backed(&self) -> bool
Whether this detector is currently using the WaveKat backend.
pub fn backend_name(&self) -> &'static str
pub fn backend_name(&self) -> &'static str
Name of the active backend.
pub fn last_probability(&self) -> Option<f32>
pub fn last_probability(&self) -> Option<f32>
Last normalized speech probability or binary backend decision.
pub fn drain_pre_speech(&mut self) -> Vec<Vec<i16>>
pub fn drain_pre_speech(&mut self) -> Vec<Vec<i16>>
Get pre-speech frames (the frames captured just before speech onset).
pub fn process_frame(&mut self, samples: &[i16]) -> Option<VadEvent>
pub fn process_frame(&mut self, samples: &[i16]) -> Option<VadEvent>
Process a single audio frame and return any state-change event.
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset the VAD to its initial state.
Auto Trait Implementations§
impl Freeze for VoiceActivityDetector
impl RefUnwindSafe for VoiceActivityDetector
impl Send for VoiceActivityDetector
impl !Sync for VoiceActivityDetector
impl Unpin for VoiceActivityDetector
impl UnwindSafe for VoiceActivityDetector
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