SpeechSynthesis

external interface SpeechSynthesis(source)

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.

Properties

Link copied to clipboard
abstract val paused: Boolean

A Boolean that returns true if the SpeechSynthesis object is in a paused state.

Link copied to clipboard
abstract val pending: Boolean

A Boolean that returns true if the utterance queue contains as-yet-unspoken utterances.

Link copied to clipboard
abstract val speaking: Boolean

A Boolean that returns true if an utterance is currently in the process of being spoken — even if SpeechSynthesis is in a paused state.

Link copied to clipboard
abstract var voiceschanged: (dynamic) -> Unit?

Fired when the list of SpeechSynthesisVoice objects that would be returned by the getVoices method has changed.

Functions

Link copied to clipboard
abstract fun cancel()

Removes all utterances from the utterance queue.

Link copied to clipboard

Returns a list of SpeechSynthesisVoice objects representing all the available voices on the current device.

Link copied to clipboard
abstract fun pause()

Puts the SpeechSynthesis object into a paused state.

Link copied to clipboard
abstract fun resume()

Puts the SpeechSynthesis object into a non-paused state: resumes it if it was already paused.

Link copied to clipboard
abstract fun speak(utterance: SpeechSynthesisUtterance)

Adds an utterance to the utterance queue; it will be spoken when any other utterances queued before it have been spoken.