pub struct SpeechWriter { /* private fields */ }Expand description
The synthesis end of an utterance. Dropping it without finish ends the
speech the way a vanished synthesizer does.
Implementations§
Source§impl SpeechWriter
impl SpeechWriter
Sourcepub fn write(&mut self, samples: &[f32]) -> Result<(), StreamClosed>
pub fn write(&mut self, samples: &[f32]) -> Result<(), StreamClosed>
Appends samples, waiting while the buffer is full. Returns an error when the reader is gone or synthesis has ended.
Sourcepub fn fail(self, error: SynthesisError)
pub fn fail(self, error: SynthesisError)
Ends the utterance with its cause. The reader learns error instead
of a bare end.
Trait Implementations§
Source§impl Drop for SpeechWriter
impl Drop for SpeechWriter
Auto Trait Implementations§
impl Freeze for SpeechWriter
impl RefUnwindSafe for SpeechWriter
impl Send for SpeechWriter
impl Sync for SpeechWriter
impl Unpin for SpeechWriter
impl UnsafeUnpin for SpeechWriter
impl UnwindSafe for SpeechWriter
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