SpeechSynthesisUtterance

external class SpeechSynthesisUtterance(text: String) : EventTarget

The SpeechSynthesisUtterance interface of the Web Speech API represents a speech request. It contains the content the speech service should read and information about how to read it (e.g. language, pitch and volume.)

Constructors

Link copied to clipboard
fun SpeechSynthesisUtterance(text: String = definedExternally)

Functions

Link copied to clipboard
fun addEventListener(type: String, callback: (Event) -> Unit?, options: dynamic)
fun addEventListener(type: String, callback: EventListener?, options: dynamic)
Link copied to clipboard
fun dispatchEvent(event: Event): Boolean
Link copied to clipboard
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: dynamic)
fun removeEventListener(type: String, callback: EventListener?, options: dynamic)

Properties

Link copied to clipboard
var lang: String

Gets and sets the language of the utterance.

Link copied to clipboard
var onend: (dynamic) -> Unit?
Link copied to clipboard
var onstart: (dynamic) -> Unit?
Link copied to clipboard
var pitch: Float

Gets and sets the pitch at which the utterance will be spoken at.

Link copied to clipboard
var rate: Float

Gets and sets the speed at which the utterance will be spoken at.

Link copied to clipboard
var text: String

Gets and sets the text that will be synthesised when the utterance is spoken.

Link copied to clipboard
var voice: SpeechSynthesisVoice?

Gets and sets the voice that will be used to speak the utterance.

Link copied to clipboard
var volume: Float

Gets and sets the volume that the utterance will be spoken at.

Sources

Link copied to clipboard