pub struct Tts(_);
Implementations
sourceimpl Tts
impl Tts
sourcepub fn new(backend: Backends) -> Result<Tts, Error>
pub fn new(backend: Backends) -> Result<Tts, Error>
Create a new TTS
instance with the specified backend.
pub fn default() -> Result<Tts, Error>
sourcepub fn supported_features(&self) -> Features
pub fn supported_features(&self) -> Features
Returns the features supported by this TTS engine
sourcepub fn speak<S: Into<String>>(
&mut self,
text: S,
interrupt: bool
) -> Result<Option<UtteranceId>, Error>
pub fn speak<S: Into<String>>(
&mut self,
text: S,
interrupt: bool
) -> Result<Option<UtteranceId>, Error>
Speaks the specified text, optionally interrupting current speech.
sourcepub fn normal_rate(&self) -> f32
pub fn normal_rate(&self) -> f32
Returns the normal rate for this speech synthesizer.
sourcepub fn normal_pitch(&self) -> f32
pub fn normal_pitch(&self) -> f32
Returns the normal pitch for this speech synthesizer.
sourcepub fn min_volume(&self) -> f32
pub fn min_volume(&self) -> f32
Returns the minimum volume for this speech synthesizer.
sourcepub fn max_volume(&self) -> f32
pub fn max_volume(&self) -> f32
Returns the maximum volume for this speech synthesizer.
sourcepub fn normal_volume(&self) -> f32
pub fn normal_volume(&self) -> f32
Returns the normal volume for this speech synthesizer.
sourcepub fn get_volume(&self) -> Result<f32, Error>
pub fn get_volume(&self) -> Result<f32, Error>
Gets the current speech volume.
sourcepub fn set_volume(&mut self, volume: f32) -> Result<&Self, Error>
pub fn set_volume(&mut self, volume: f32) -> Result<&Self, Error>
Sets the desired speech volume.
sourcepub fn is_speaking(&self) -> Result<bool, Error>
pub fn is_speaking(&self) -> Result<bool, Error>
Returns whether this speech synthesizer is speaking.
sourcepub fn on_utterance_begin(
&self,
callback: Option<Box<dyn FnMut(UtteranceId)>>
) -> Result<(), Error>
pub fn on_utterance_begin(
&self,
callback: Option<Box<dyn FnMut(UtteranceId)>>
) -> Result<(), Error>
Called when this speech synthesizer begins speaking an utterance.
sourcepub fn on_utterance_end(
&self,
callback: Option<Box<dyn FnMut(UtteranceId)>>
) -> Result<(), Error>
pub fn on_utterance_end(
&self,
callback: Option<Box<dyn FnMut(UtteranceId)>>
) -> Result<(), Error>
Called when this speech synthesizer finishes speaking an utterance.
sourcepub fn on_utterance_stop(
&self,
callback: Option<Box<dyn FnMut(UtteranceId)>>
) -> Result<(), Error>
pub fn on_utterance_stop(
&self,
callback: Option<Box<dyn FnMut(UtteranceId)>>
) -> Result<(), Error>
Called when this speech synthesizer is stopped and still has utterances in its queue.
pub fn screen_reader_available() -> bool
Trait Implementations
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more