pub struct PipecatSmartTurn { /* private fields */ }Expand description
Pipecat Smart Turn v3 detector.
Buffers up to 8 seconds of audio internally. Call push_audio with
every incoming 16 kHz frame, then call predict when the VAD fires
end-of-speech to get a TurnPrediction.
§Usage with VAD
use wavekat_turn::audio::PipecatSmartTurn;
use wavekat_turn::AudioTurnDetector;
let mut detector = PipecatSmartTurn::new().unwrap();
// ... feed frames via push_audio ...
let prediction = detector.predict().unwrap();
println!("{:?} ({:.2})", prediction.state, prediction.confidence);Implementations§
Trait Implementations§
Source§impl AudioTurnDetector for PipecatSmartTurn
impl AudioTurnDetector for PipecatSmartTurn
Source§fn push_audio(&mut self, frame: &AudioFrame<'_>)
fn push_audio(&mut self, frame: &AudioFrame<'_>)
Append audio to the internal ring buffer.
Frames with a sample rate other than 16 kHz are silently dropped. The ring buffer holds at most 8 s; older samples are evicted.
impl Send for PipecatSmartTurn
impl Sync for PipecatSmartTurn
Auto Trait Implementations§
impl Freeze for PipecatSmartTurn
impl !RefUnwindSafe for PipecatSmartTurn
impl Unpin for PipecatSmartTurn
impl UnsafeUnpin for PipecatSmartTurn
impl !UnwindSafe for PipecatSmartTurn
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