SpeechSynthesis

The SpeechSynthesis interface of the Web Speech API is the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides.

MDN Reference

Properties

Link copied to clipboard

The paused read-only property of the true if the SpeechSynthesis object is in a paused state, or false if not.

Link copied to clipboard

The pending read-only property of the true if the utterance queue contains as-yet-unspoken utterances.

Link copied to clipboard

The speaking read-only property of the true if an utterance is currently in the process of being spoken — even if SpeechSynthesis is in a A boolean value.

Functions

Link copied to clipboard
fun cancel()

The cancel() method of the SpeechSynthesis interface removes all utterances from the utterance queue.

Link copied to clipboard
Link copied to clipboard

The getVoices() method of the current device.

Link copied to clipboard
fun pause()

The pause() method of the SpeechSynthesis interface puts the SpeechSynthesis object into a paused state.

Link copied to clipboard
fun resume()

The resume() method of the SpeechSynthesis interface puts the SpeechSynthesis object into a non-paused state: resumes it if it was already paused.

Link copied to clipboard

The speak() method of the SpeechSynthesis interface adds an SpeechSynthesisUtterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken.

Link copied to clipboard