Expand description
Text-to-speech API.
§Synthesizer
The entry point for speech synthesis is the synthesizer. This module provides two variants of synthesizers:
SyncSynthesizerwill block the current thread until the speech synthesis is finished, or until the given timeout.EventfulSynthesizerwill 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§
- Eventful
Synthesizer - 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.
- Speech
Builder - Helper type that can construct a
Speechfrom a sequence of rendering instructions. - Sync
Synthesizer - 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.
- Voice
Selector - 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.
- Speech
Output - Specifies where the output of speech synthesis should go.
- Voice
Age - Specifies the age of a voice.
- Voice
Gender - Specifies the gender of a voice.
Traits§
- Event
Handler - The handler
EventfulSynthesizerwill call.
Functions§
- installed_
voices - If successful, returns an iterator enumerating all the installed voices that satisfy the given criteria.