pub struct Synthesis<T> { /* private fields */ }Available on non-
target_family=wasm only.Expand description
A loaded synthesis engine ready to start utterances.
Implementations§
Source§impl<T: Engine> Synthesis<T>
impl<T: Engine> Synthesis<T>
Sourcepub fn start(&self, text: &SpeechText) -> Result<Session, SynthesisError>
pub fn start(&self, text: &SpeechText) -> Result<Session, SynthesisError>
Starts an utterance with the engine’s default voice and natural pace.
Sourcepub fn start_with(
&self,
text: &SpeechText,
voice: Option<&Voice>,
rate: SpeakingRate,
cancel: &CancelToken,
) -> Result<Session, SynthesisError>
pub fn start_with( &self, text: &SpeechText, voice: Option<&Voice>, rate: SpeakingRate, cancel: &CancelToken, ) -> Result<Session, SynthesisError>
Starts an utterance and returns its PCM as it is produced.
An engine that owns playback cannot provide a PCM session. Use
Synthesis::speak_with for that engine instead.
Source§impl<T: Engine> Synthesis<T>
impl<T: Engine> Synthesis<T>
Sourcepub fn speak(&self, text: &SpeechText) -> Result<(), SynthesisError>
Available on crate feature playback only.
pub fn speak(&self, text: &SpeechText) -> Result<(), SynthesisError>
playback only.Speaks with the engine’s default voice at its natural pace and waits until the utterance has been heard.
Sourcepub fn speak_with(
&self,
text: &SpeechText,
voice: Option<&Voice>,
rate: SpeakingRate,
cancel: &CancelToken,
) -> Result<(), SynthesisError>
Available on crate feature playback only.
pub fn speak_with( &self, text: &SpeechText, voice: Option<&Voice>, rate: SpeakingRate, cancel: &CancelToken, ) -> Result<(), SynthesisError>
playback only.Speaks one utterance and waits until it has been heard.
Auto Trait Implementations§
impl<T> Freeze for Synthesis<T>
impl<T> RefUnwindSafe for Synthesis<T>where
Arc<T>: RefUnwindSafe,
impl<T> Send for Synthesis<T>
impl<T> Sync for Synthesis<T>
impl<T> Unpin for Synthesis<T>
impl<T> UnsafeUnpin for Synthesis<T>where
Arc<T>: UnsafeUnpin,
impl<T> UnwindSafe for Synthesis<T>where
Arc<T>: UnwindSafe,
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