Controls text-to-speech functionality. More...
Import Statement: | import ArcGIS.AppFramework.Speech 1.0 |
Properties
- availableLocales : QStringList
- availableVoices : List<Voice>
- locale : string
- pitch : double
- rate : double
- state : State
- voice : Voice
- volume : double
Signals
- pitchChanged(double)
- rateChanged(double)
- stateChanged(State state)
- volumeChanged(double)
Methods
Detailed Description
This code sample demonstrates usage of the TextToSpeech component. On pressing the "Say it" button, the text written into the text field will be read by the app, with the system default age and gender and a set volume and speech rate.
Item { TextField { id: text anchors.centerIn: parent text: qsTr("Put Some Text Here") } Button { text: qsTr ("Say it") onClicked: { textToSpeech.say(text.text) console.log(textToSpeech.voice.gender) } } TextToSpeech { id: textToSpeech volume: 0.7 rate: 0.3 } }
Enumerations
State enumeration
Enum describing the possible playback states of the text-to-speech reading. Informs the State property, and the stateChanged enum.
Name | Value |
---|---|
TextToSpeech.Ready | 0 |
TextToSpeech.Speaking | 1 |
TextToSpeech.Paused | 2 |
TextToSpeech.BackendError | 3 |
Property Documentation
[read-only] availableVoices : List<Voice> |
Returns a list of available voices to use.
The pitch of the reading. This property ranges from -1.0 to 1.0, with 0.0 being normal speech pitch.
Sets the speech rate. This property ranges from -1.0 to 1.0, with 0.0 being normal speech flow.
The current playback state of the text-to-speech reading. Uses the State enum.
voice : Voice |
The voice used for the text-to-speech reading. This is controlled by the Voice component.
The volume of the text-to-speech reading. This is represented as a value between 0 and 1, with the default being 1 (full volume).
Signal Documentation
Signal emitted when the pitch of the reading has changed.
Note: The corresponding handler is onPitchChanged
.
Signal emitted when the speech rate has changed.
Note: The corresponding handler is onRateChanged
.
Signal emitted when the playback state of the text-to-speech reading has changed. Uses the State enum.
Note: The corresponding handler is onStateChanged
.
Signal emitted when the volume of the text-to-speech has changed.
Note: The corresponding handler is onVolumeChanged
.