Skip to main content

SpeechSynthesisUtterance

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

MDN Reference

Extends​

Methods​

addEventListener()​

Call Signature​

addEventListener<K>(
type,
listener,
options?
): void;

The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

MDN Reference

Type Parameters​
Type Parameter
K extends keyof SpeechSynthesisUtteranceEventMap
Parameters​
ParameterType
typeK
listener(this, ev) => any
options?boolean | AddEventListenerOptions
Returns​

void

Overrides​

EventTarget.addEventListener

Call Signature​

addEventListener(
type,
listener,
options?
): void;

The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

MDN Reference

Parameters​
ParameterType
typestring
listenerEventListenerOrEventListenerObject
options?boolean | AddEventListenerOptions
Returns​

void

Overrides​
EventTarget.addEventListener

dispatchEvent()​

dispatchEvent(event): boolean;

The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().

MDN Reference

Parameters​

ParameterType
eventEvent

Returns​

boolean

Inherited from​

EventTarget.dispatchEvent


removeEventListener()​

Call Signature​

removeEventListener<K>(
type,
listener,
options?
): void;

The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

MDN Reference

Type Parameters​
Type Parameter
K extends keyof SpeechSynthesisUtteranceEventMap
Parameters​
ParameterType
typeK
listener(this, ev) => any
options?boolean | EventListenerOptions
Returns​

void

Overrides​

EventTarget.removeEventListener

Call Signature​

removeEventListener(
type,
listener,
options?
): void;

The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

MDN Reference

Parameters​
ParameterType
typestring
listenerEventListenerOrEventListenerObject
options?boolean | EventListenerOptions
Returns​

void

Overrides​
EventTarget.removeEventListener

Properties​

lang​

lang: string;

The lang property of the SpeechSynthesisUtterance interface gets and sets the language of the utterance.

MDN Reference


onboundary​

onboundary: ((this, ev) => any) | null;

MDN Reference


onend​

onend: ((this, ev) => any) | null;

MDN Reference


onerror​

onerror: ((this, ev) => any) | null;

MDN Reference


onmark​

onmark: ((this, ev) => any) | null;

MDN Reference


onpause​

onpause: ((this, ev) => any) | null;

MDN Reference


onresume​

onresume: ((this, ev) => any) | null;

MDN Reference


onstart​

onstart: ((this, ev) => any) | null;

MDN Reference


pitch​

pitch: number;

The pitch property of the SpeechSynthesisUtterance interface gets and sets the pitch at which the utterance will be spoken at.

MDN Reference


rate​

rate: number;

The rate property of the SpeechSynthesisUtterance interface gets and sets the speed at which the utterance will be spoken at.

MDN Reference


text​

text: string;

The text property of the SpeechSynthesisUtterance interface gets and sets the text that will be synthesized when the utterance is spoken.

MDN Reference


voice​

voice: SpeechSynthesisVoice | null;

The voice property of the SpeechSynthesisUtterance interface gets and sets the voice that will be used to speak the utterance.

MDN Reference


volume​

volume: number;

The volume property of the SpeechSynthesisUtterance interface gets and sets the volume that the utterance will be spoken at.

MDN Reference