Skip to main content

VadConfig

Struct VadConfig 

Source
pub struct VadConfig {
    pub threshold: f32,
    pub neg_threshold: Option<f32>,
    pub min_speech_ms: u32,
    pub min_silence_ms: u32,
    pub speech_pad_ms: u32,
    pub max_speech_ms: u32,
    pub sample_rate: u32,
}
Expand description

VAD の挙動を制御する設定。

デフォルト値は silero-VAD の get_speech_timestamps に揃えてある。

Fields§

§threshold: f32

発話開始とみなす確率しきい値 (>=)。既定 0.5。

§neg_threshold: Option<f32>

無音開始とみなす負側しきい値 (<)。None なら max(threshold - 0.15, 0.01)(silero 準拠)。

§min_speech_ms: u32

採用する発話の最小長 (ms)。これ未満のセグメントは破棄。既定 250。

§min_silence_ms: u32

発話終了の確定に必要な無音長 (ms)。既定 100(silero)。

§speech_pad_ms: u32

セグメント境界を前後に広げるパディング (ms)。既定 30(silero)。

§max_speech_ms: u32

1 セグメントの最大長 (ms)。0 = 無制限。超過時は強制分割。既定 0。

§sample_rate: u32

サンプルレート。8000 または 16000 のみ。既定 16000。

Implementations§

Source§

impl VadConfig

Source

pub fn aggressive() -> Self

取りこぼしを減らす感度高めのプリセット。

しきい値を下げ、短い無音でも発話を継続しやすくする。

Source

pub fn balanced() -> Self

バランス型プリセット。silero のデフォルト(VadConfig::default)と同じ。

Source

pub fn conservative() -> Self

誤検出を減らす保守的なプリセット。

しきい値を上げ、より長い無音で発話を切る。

Source

pub fn resolved_neg_threshold(&self) -> f32

実効的な負側しきい値を返す。

明示指定があればそれを、なければ max(threshold - 0.15, 0.01)(silero 準拠)。

Trait Implementations§

Source§

impl Clone for VadConfig

Source§

fn clone(&self) -> VadConfig

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 VadConfig

Source§

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

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

impl Default for VadConfig

Source§

fn default() -> Self

silero のデフォルト(VadConfig::balanced と同じ)。

Source§

impl PartialEq for VadConfig

Source§

fn eq(&self, other: &VadConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for VadConfig

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> 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