pub enum TtsEvent {
Audio(Vec<u8>),
WordBoundary {
offset: u64,
duration: u64,
text: String,
},
TurnEnd,
}Expand description
One item in the event stream produced by crate::Engine::synthesize.
Events arrive in order. A well-formed turn starts with zero or more
Audio / WordBoundary
events and terminates with exactly one TurnEnd.
Variants§
Audio(Vec<u8>)
A chunk of raw MP3 audio bytes (audio-24khz-48kbitrate-mono-mp3).
Concatenate all Audio events in order to reconstruct the full
utterance.
WordBoundary
Word-boundary timing metadata for highlight / karaoke effects.
offset and duration are in 100-nanosecond ticks relative to
the start of the audio stream.
TurnEnd
The server signalled turn.end - no more audio or metadata will
arrive for this request.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TtsEvent
impl RefUnwindSafe for TtsEvent
impl Send for TtsEvent
impl Sync for TtsEvent
impl Unpin for TtsEvent
impl UnsafeUnpin for TtsEvent
impl UnwindSafe for TtsEvent
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