SpeechSynthesis

actual abstract external class SpeechSynthesis : EventTarget(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.

expect abstract class 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.

actual abstract external class SpeechSynthesis : EventTarget(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.

Constructors

Link copied to clipboard
constructor()
constructor()

Properties

Link copied to clipboard
actual val paused: Boolean

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

expect val paused: Boolean

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

actual val paused: Boolean

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

Link copied to clipboard
actual val pending: Boolean

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

expect val pending: Boolean

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

actual val pending: Boolean

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

Link copied to clipboard
actual 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.

expect 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.

actual 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
actual var voiceschanged: (event: JsAny?) -> Unit?

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

expect var voiceschanged: (event: JsAny?) -> Unit?

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

actual var voiceschanged: (event: JsAny?) -> Unit?

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

Functions

addEventListener
Link copied to clipboard
fun addEventListener(type: String, callback: (Event) -> Unit?, options: dynamic)
fun addEventListener(type: String, callback: EventListener?, options: dynamic)
fun addEventListener(type: String, callback: (Event) -> Unit?)
fun addEventListener(type: String, callback: EventListener?)
fun addEventListener(type: String, callback: (Event) -> Unit?, options: Boolean)
fun addEventListener(type: String, callback: (Event) -> Unit?, options: AddEventListenerOptions)
fun addEventListener(type: String, callback: EventListener?, options: Boolean)
Link copied to clipboard
actual fun cancel()

Removes all utterances from the utterance queue.

expect fun cancel()

Removes all utterances from the utterance queue.

actual fun cancel()

Removes all utterances from the utterance queue.

dispatchEvent
Link copied to clipboard
Link copied to clipboard

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

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

Link copied to clipboard
actual fun pause()

Puts the SpeechSynthesis object into a paused state.

expect fun pause()

Puts the SpeechSynthesis object into a paused state.

actual fun pause()

Puts the SpeechSynthesis object into a paused state.

removeEventListener
Link copied to clipboard
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: dynamic)
fun removeEventListener(type: String, callback: EventListener?, options: dynamic)
fun removeEventListener(type: String, callback: (Event) -> Unit?)
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: Boolean)
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: EventListenerOptions)
fun removeEventListener(type: String, callback: EventListener?, options: Boolean)
Link copied to clipboard
actual fun resume()

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

expect fun resume()

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

actual fun resume()

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

Link copied to clipboard
actual 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.

expect 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.

actual 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.