Skip to main content

VadOptions

Struct VadOptions 

Source
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

Source

pub const fn new() -> Self

Create VadOptions with upstream FireRedStreamVadConfig defaults.

Source

pub const fn smooth_window_size(&self) -> u32

Smoothing-window size in frames (10 ms each).

Source

pub const fn set_smooth_window_size(&mut self, size: u32) -> &mut Self

Set the smoothing-window size; returns &mut Self for chaining.

Source

pub const fn with_smooth_window_size(self, size: u32) -> Self

Builder variant of Self::set_smooth_window_size.

Source

pub const fn speech_threshold(&self) -> f32

Threshold above which a smoothed probability counts as speech.

Source

pub const fn set_speech_threshold(&mut self, t: f32) -> &mut Self

Set the speech threshold; values are clamped into [0, 1].

Source

pub const fn with_speech_threshold(self, t: f32) -> Self

Builder variant of Self::set_speech_threshold.

Source

pub const fn pad_start(&self) -> Duration

Padding extending the start of every emitted speech segment backward.

Source

pub const fn set_pad_start(&mut self, d: Duration) -> &mut Self

Set pad_start; returns &mut Self for chaining.

Source

pub const fn with_pad_start(self, d: Duration) -> Self

Builder variant of Self::set_pad_start.

Source

pub const fn min_speech_duration(&self) -> Duration

Minimum speech duration before a POSSIBLE_SPEECH run promotes to SPEECH.

Source

pub const fn set_min_speech_duration(&mut self, d: Duration) -> &mut Self

Set the minimum speech duration; returns &mut Self for chaining.

Source

pub const fn with_min_speech_duration(self, d: Duration) -> Self

Builder variant of Self::set_min_speech_duration.

Source

pub const fn max_speech_duration(&self) -> Option<Duration>

Maximum speech duration before a force-split (None disables force-split).

Source

pub const fn set_max_speech_duration(&mut self, d: Duration) -> &mut Self

Set the maximum speech duration; returns &mut Self for chaining.

Source

pub const fn with_max_speech_duration(self, d: Duration) -> Self

Builder variant of Self::set_max_speech_duration.

Source

pub const fn clear_max_speech_duration(self) -> Self

Disable max-speech force-splitting.

Source

pub const fn min_silence_duration(&self) -> Duration

Minimum silence duration required to close an open speech segment.

Source

pub const fn set_min_silence_duration(&mut self, d: Duration) -> &mut Self

Set the minimum silence duration; returns &mut Self for chaining.

Source

pub const fn with_min_silence_duration(self, d: Duration) -> Self

Builder variant of Self::set_min_silence_duration.

Source

pub const fn session_options(&self) -> &SessionOptions

The session options used when constructing the ONNX runtime.

Source

pub const fn set_session_options(&mut self, opts: SessionOptions) -> &mut Self

Set the SessionOptions; returns &mut Self for chaining.

Source

pub const fn with_session_options(self, opts: SessionOptions) -> Self

Builder variant of Self::set_session_options.

Trait Implementations§

Source§

impl Clone for VadOptions

Source§

fn clone(&self) -> VadOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VadOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for VadOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for VadOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for VadOptions

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more