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

Documentation SpeechSynthesisUtterance by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Constructor

new(text:String)

new()

Throws:

null

DOMError

Variables

lang:String

Gets and sets the language of the utterance.

onboundary:Function

Fired when the spoken utterance reaches a word or sentence boundary.

onend:Function

Fired when the utterance has finished being spoken.

onerror:Function

Fired when an error occurs that prevents the utterance from being succesfully spoken.

onmark:Function

Fired when the spoken utterance reaches a named SSML "mark" tag.

onpause:Function

Fired when the utterance is paused part way through.

onresume:Function

Fired when a paused utterance is resumed.

onstart:Function

Fired when the utterance has begun to be spoken.

pitch:Float

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

rate:Float

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

text:String

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

voice:SpeechSynthesisVoice

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

volume:Float

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

Inherited Variables

Inherited Methods

Defined by EventTarget

addEventListener(type:String, listener:Function, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

addEventListener(type:String, listener:EventListener, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

Register an event handler of a specific event type on the EventTarget.

Throws:

null

DOMError

dispatchEvent(event:Event):Bool

Dispatch an event to this EventTarget.

Throws:

null

DOMError

removeEventListener(type:String, listener:Function, ?options:EitherType<EventListenerOptions, Bool>):Void

removeEventListener(type:String, listener:EventListener, ?options:EitherType<EventListenerOptions, Bool>):Void

Removes an event listener from the EventTarget.

Throws:

null

DOMError