Struct TurnDetector
pub struct TurnDetector { /* private fields */ }Expand description
Client-side turn detector.
Implementations§
§impl TurnDetector
impl TurnDetector
pub fn new(config: TurnDetectionConfig) -> TurnDetector
pub fn new(config: TurnDetectionConfig) -> TurnDetector
Create a new turn detector.
pub fn update(&mut self, vad_is_speaking: bool) -> Option<TurnDetectionEvent>
pub fn update(&mut self, vad_is_speaking: bool) -> Option<TurnDetectionEvent>
Update with the current VAD state.
Returns a TurnDetectionEvent if a transition occurred.
pub fn is_speaking(&self) -> bool
pub fn is_speaking(&self) -> bool
Whether speech is currently in progress.
pub fn is_pending_turn_end(&self) -> bool
pub fn is_pending_turn_end(&self) -> bool
Whether we’re waiting for the end-of-speech delay.
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset the detector state.
Auto Trait Implementations§
impl Freeze for TurnDetector
impl RefUnwindSafe for TurnDetector
impl Send for TurnDetector
impl Sync for TurnDetector
impl Unpin for TurnDetector
impl UnwindSafe for TurnDetector
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