TextToSpeech QML Type
The TextToSpeech type provides access to text-to-speech engines. More...
|Import Statement:||import QtTextToSpeech|
- engine : string
- locale : locale
- pitch : double
- rate : double
- state : enumeration
- voice : Voice
- volume : double
- void errorOccured(enumeration reason, string errorString)
- list<string> availableEngines()
- list<Voice> availableLocales()
- list<Voice> availableVoices()
- enumeration errorReason()
- string errorString()
- pause(BoundaryHint boundaryHint)
- say(string text)
- stop(BoundaryHint boundaryHint)
The list of voices the engine supports for the current language is returned by availableVoices(). Change the language using the locale property, using one of the availableLocales() that is a good match for the language that the input text is in, and for the accent of the desired voice output. This will change the list of available voices on most platforms. Then use one of the available voices in the voice property.
Note: Which locales and voices the engine supports depends usually on the Operating System configuration. E.g. on macOS, end users can install voices through the Accessibility panel in System Preferences.
engine : string
locale : locale
This property holds the current locale in use.
By default, the system locale is used.
See also voice.
pitch : double
This property hold the voice pitch, ranging from -1.0 to 1.0.
The default of 0.0 is the normal speech pitch.
rate : double
This property holds the current voice rate, ranging from -1.0 to 1.0.
The default of 0.0 is the normal speech flow.
state : enumeration
voice : Voice
volume : double
This property holds the current volume, ranging from 0.0 to 1.0.
The default value is the platform's default volume.
void errorOccured(enumeration reason, string errorString)
This signal is emitted after an error occurred and the state has been set to
TextToSpeech.Error. The reason parameter specifies the type of error, and the errorString provides a human-readable error description.
Note: The corresponding handler is
Holds the list of supported text-to-speech engine plug-ins.
Holds the list of locales that are supported by the active engine.
Holds the list of voices available for the current locale.
Returns the reason why the engine has reported an error.
See also QTextToSpeech::ErrorReason.
Returns the current engine error message.
Starts synthesizing the text.
This function starts sythesizing the speech asynchronously, and reads the text to the default audio output device.
Note: All in-progress readings are stopped before beginning to read the recently synthesized text.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.