Talk

Trait Talk 

Source
pub trait Talk {
    // Required method
    async fn talk(&self) -> Result<(), VoiceIoError>;
}
Expand description

Run a full-duplex voice conversation on the system’s default audio devices.

talk() bridges the default microphone and speakers into the session via pump: capture is down-mixed to mono and resampled to the session’s input rate; model speech is resampled to the device rate and buffered; an interruption flushes the buffer instantly (barge-in); the session’s voice reactor is told when playback drains. Returns when the session ends or on Ctrl-C.

Required Methods§

Source

async fn talk(&self) -> Result<(), VoiceIoError>

See the trait docs. The five-line voice app:

// `ignore`: opens the default microphone and speakers (feature `voice-io`).
Live::builder()
    .instruction("You are a helpful concierge.")
    .greeting("Greet the caller.")
    .connect_from_env().await?
    .talk().await?;

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§