[−][src]Struct fvad::Fvad
Implementations
impl Fvad
[src]
pub fn new() -> Option<Self>
[src]
Creates and initializes a VAD instance.
Returns:
Some(Self)
wrapping a pointer to the new VAD instance on successNone
in case of a memory allocation error
pub fn reset(self)
[src]
Reinitializes a VAD instance, clearing all state and resetting mode and sample rate to defaults.
pub fn set_mode(self, mode: Mode) -> Self
[src]
Changes the VAD operating ("aggressiveness") mode of a VAD instance.
A more aggressive (higher mode) VAD is more restrictive in reporting speech.
Put in other words the probability of being speech when the VAD returns 1 is
increased with increasing mode. As a consequence also the missed detection
rate goes up.
The default mode is Mode::Quality
.
pub fn set_sample_rate(self, sample_rate: SampleRate) -> Self
[src]
Sets the input sample rate in Hz for a VAD instance.
Note that internally all processing will be done 8000 Hz; input data in higher sample rates will just be downsampled first.
pub fn is_voice_frame(&mut self, frame: &[i16]) -> Option<bool>
[src]
Calculates a VAD decision for an audio frame.
frame
is a slice of signed 16-bit samples. Only slices with a
length of 10, 20 or 30 ms are supported, so for example at 8 kHz, frame.len()
must be either 80, 160 or 240.
Returns:
Some(true)
on active voice detectionSome(false)
on no active voice detectionNone
on invalid frame length
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Fvad
[src]
impl !Sync for Fvad
[src]
impl Unpin for Fvad
[src]
impl UnwindSafe for Fvad
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,