pub struct SpeakerOutput;Available on crate feature
playback and non-target_family=wasm only.Expand description
Checks for an output device at construction and resolves it again for each utterance.
Implementations§
Source§impl SpeakerOutput
impl SpeakerOutput
pub fn new() -> Result<Self, PlaybackError>
Sourcepub fn play_with(
&self,
speech: SpeechStream,
cancel: &CancelToken,
started: impl FnOnce(),
) -> Result<(), PlaybackError>
pub fn play_with( &self, speech: SpeechStream, cancel: &CancelToken, started: impl FnOnce(), ) -> Result<(), PlaybackError>
Calls started when the first source sample reaches the output callback.
Waits a drain grace period after the final sample. Cancellation drops the stream.
Auto Trait Implementations§
impl Freeze for SpeakerOutput
impl RefUnwindSafe for SpeakerOutput
impl Send for SpeakerOutput
impl Sync for SpeakerOutput
impl Unpin for SpeakerOutput
impl UnsafeUnpin for SpeakerOutput
impl UnwindSafe for SpeakerOutput
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