use futures_core::Stream;
#[derive(Debug, Clone)]
pub struct BlendShape {
pub key: Box<str>,
pub weight: f32
}
#[derive(Debug, Clone)]
pub struct BlendShapeVisemeFrame {
pub blendshapes: Box<[BlendShape]>,
pub frame_offset: f32
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct BasicViseme(pub char);
#[derive(Debug, Clone)]
pub struct BasicVisemeFrame {
pub viseme: BasicViseme,
pub frame_offset: f32
}
#[derive(Debug)]
#[non_exhaustive]
pub enum UtteranceEvent {
SsmlMark {
at_millis: f32,
mark: Box<str>
},
WordBoundary {
from_millis: f32,
to_millis: f32,
text: Box<str>
},
SentenceBoundary {
from_millis: f32,
to_millis: f32,
text: Box<str>
},
BlendShapeVisemesChunk(Box<[BlendShapeVisemeFrame]>),
VisemesChunk(Box<[BasicVisemeFrame]>),
AudioChunk(Box<[u8]>)
}
pub trait UtteranceEventStream<E>: Stream<Item = Result<UtteranceEvent, E>> + Send {}
impl<E, T: Stream<Item = Result<UtteranceEvent, E>> + Send> UtteranceEventStream<E> for T {}