pub struct VadOptions { /* private fields */ }Expand description
Configuration for turning streaming probabilities into speech segments.
Defaults reproduce upstream Python’s FireRedStreamVadConfig exactly.
The four upstream “mode” presets are not exposed as an enum — see
the crate-level docs for the recipe values you can apply via the
with_* builders directly.
Implementations§
Source§impl VadOptions
impl VadOptions
Sourcepub const fn smooth_window_size(&self) -> u32
pub const fn smooth_window_size(&self) -> u32
Smoothing-window size in frames (10 ms each).
Sourcepub const fn set_smooth_window_size(&mut self, size: u32) -> &mut Self
pub const fn set_smooth_window_size(&mut self, size: u32) -> &mut Self
Set the smoothing-window size; returns &mut Self for chaining.
Sourcepub const fn with_smooth_window_size(self, size: u32) -> Self
pub const fn with_smooth_window_size(self, size: u32) -> Self
Builder variant of Self::set_smooth_window_size.
Sourcepub const fn speech_threshold(&self) -> f32
pub const fn speech_threshold(&self) -> f32
Threshold above which a smoothed probability counts as speech.
Sourcepub const fn set_speech_threshold(&mut self, t: f32) -> &mut Self
pub const fn set_speech_threshold(&mut self, t: f32) -> &mut Self
Set the speech threshold; values are clamped into [0, 1].
Sourcepub const fn with_speech_threshold(self, t: f32) -> Self
pub const fn with_speech_threshold(self, t: f32) -> Self
Builder variant of Self::set_speech_threshold.
Sourcepub const fn pad_start(&self) -> Duration
pub const fn pad_start(&self) -> Duration
Padding extending the start of every emitted speech segment backward.
Sourcepub const fn set_pad_start(&mut self, d: Duration) -> &mut Self
pub const fn set_pad_start(&mut self, d: Duration) -> &mut Self
Set pad_start; returns &mut Self for chaining.
Sourcepub const fn with_pad_start(self, d: Duration) -> Self
pub const fn with_pad_start(self, d: Duration) -> Self
Builder variant of Self::set_pad_start.
Sourcepub const fn min_speech_duration(&self) -> Duration
pub const fn min_speech_duration(&self) -> Duration
Minimum speech duration before a POSSIBLE_SPEECH run promotes to SPEECH.
Sourcepub const fn set_min_speech_duration(&mut self, d: Duration) -> &mut Self
pub const fn set_min_speech_duration(&mut self, d: Duration) -> &mut Self
Set the minimum speech duration; returns &mut Self for chaining.
Sourcepub const fn with_min_speech_duration(self, d: Duration) -> Self
pub const fn with_min_speech_duration(self, d: Duration) -> Self
Builder variant of Self::set_min_speech_duration.
Sourcepub const fn max_speech_duration(&self) -> Option<Duration>
pub const fn max_speech_duration(&self) -> Option<Duration>
Maximum speech duration before a force-split (None disables force-split).
Sourcepub const fn set_max_speech_duration(&mut self, d: Duration) -> &mut Self
pub const fn set_max_speech_duration(&mut self, d: Duration) -> &mut Self
Set the maximum speech duration; returns &mut Self for chaining.
Sourcepub const fn with_max_speech_duration(self, d: Duration) -> Self
pub const fn with_max_speech_duration(self, d: Duration) -> Self
Builder variant of Self::set_max_speech_duration.
Sourcepub const fn clear_max_speech_duration(self) -> Self
pub const fn clear_max_speech_duration(self) -> Self
Disable max-speech force-splitting.
Sourcepub const fn min_silence_duration(&self) -> Duration
pub const fn min_silence_duration(&self) -> Duration
Minimum silence duration required to close an open speech segment.
Sourcepub const fn set_min_silence_duration(&mut self, d: Duration) -> &mut Self
pub const fn set_min_silence_duration(&mut self, d: Duration) -> &mut Self
Set the minimum silence duration; returns &mut Self for chaining.
Sourcepub const fn with_min_silence_duration(self, d: Duration) -> Self
pub const fn with_min_silence_duration(self, d: Duration) -> Self
Builder variant of Self::set_min_silence_duration.
Sourcepub const fn session_options(&self) -> &SessionOptions
pub const fn session_options(&self) -> &SessionOptions
The session options used when constructing the ONNX runtime.
Sourcepub const fn set_session_options(&mut self, opts: SessionOptions) -> &mut Self
pub const fn set_session_options(&mut self, opts: SessionOptions) -> &mut Self
Set the SessionOptions; returns &mut Self for chaining.
Sourcepub const fn with_session_options(self, opts: SessionOptions) -> Self
pub const fn with_session_options(self, opts: SessionOptions) -> Self
Builder variant of Self::set_session_options.
Trait Implementations§
Source§impl Clone for VadOptions
impl Clone for VadOptions
Source§fn clone(&self) -> VadOptions
fn clone(&self) -> VadOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more