Skip to main content

Module tts

Module tts 

Source
Expand description

Text-to-speech API.

§Synthesizer

The entry point for speech synthesis is the synthesizer. This module provides two variants of synthesizers:

  • SyncSynthesizer will block the current thread until the speech synthesis is finished, or until the given timeout.
  • EventfulSynthesizer will return immediately and call the supplied event handler when the speech is finished.

For asynchronous synthesis, see the tokio module.

All synthesizers share the methods defined in the Synthesizer struct.

§Voice

The user can install a variety of voices on their machine. The installed_voices function allows iterating through all the installed voices, filtered by the provided criteria.

Structs§

EventfulSynthesizer
A speech synthesizer that calls the supplied event handler every time it finishes rendering speech.
Pitch
Voice pitch, represented as a value in the interval [-10, 10], with 0 being normal pitch.
Rate
Speech rate, represented as a value in the interval [-10, 10], with 0 being normal speed.
SpeechBuilder
Helper type that can construct a Speech from a sequence of rendering instructions.
SyncSynthesizer
A speech synthesizer that blocks the current thread while rendering speech.
Synthesizer
Provides the common speech synthesis API shared across different kinds of synthesizers.
Voice
A voice installed on the system.
VoiceSelector
Encapsulates the criteria for selecting a voice.
Volume
Voice volume, represented as a value in the interval [0, 100], with 100 being full volume.

Enums§

SayAs
Provides a hint about how to pronounce the associated content.
Speech
A speech to be rendered by a synthesizer.
SpeechOutput
Specifies where the output of speech synthesis should go.
VoiceAge
Specifies the age of a voice.
VoiceGender
Specifies the gender of a voice.

Traits§

EventHandler
The handler EventfulSynthesizer will call.

Functions§

installed_voices
If successful, returns an iterator enumerating all the installed voices that satisfy the given criteria.