pub struct VadConfig {
pub mode: VadMode,
pub silence_duration_ms: Option<u32>,
pub threshold: Option<f32>,
pub prefix_padding_ms: Option<u32>,
pub interrupt_response: Option<bool>,
pub eagerness: Option<String>,
}Available on crate feature
realtime only.Expand description
VAD configuration options.
Fields§
§mode: VadModeVAD mode to use.
silence_duration_ms: Option<u32>Silence duration (ms) before considering speech ended.
threshold: Option<f32>Detection threshold (0.0 - 1.0).
prefix_padding_ms: Option<u32>Prefix padding (ms) to include before detected speech.
interrupt_response: Option<bool>Whether to interrupt the model when user starts speaking.
eagerness: Option<String>Eagerness of turn detection (OpenAI-specific).
Implementations§
Source§impl VadConfig
impl VadConfig
Sourcepub fn server_vad() -> VadConfig
pub fn server_vad() -> VadConfig
Create a server VAD config with default settings.
Sourcepub fn semantic_vad() -> VadConfig
pub fn semantic_vad() -> VadConfig
Create a semantic VAD config (OpenAI).
Sourcepub fn with_silence_duration(self, ms: u32) -> VadConfig
pub fn with_silence_duration(self, ms: u32) -> VadConfig
Set silence duration threshold.
Sourcepub fn with_interrupt(self, interrupt: bool) -> VadConfig
pub fn with_interrupt(self, interrupt: bool) -> VadConfig
Set whether to interrupt on user speech.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VadConfig
impl<'de> Deserialize<'de> for VadConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<VadConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<VadConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for VadConfig
impl Serialize for VadConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for VadConfig
Auto Trait Implementations§
impl Freeze for VadConfig
impl RefUnwindSafe for VadConfig
impl Send for VadConfig
impl Sync for VadConfig
impl Unpin for VadConfig
impl UnsafeUnpin for VadConfig
impl UnwindSafe for VadConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.