Skip to main content

Class: WebSpeechSynthesizer

Defined in: src/audio/speechSynthesizer.ts:165

The default synthesizer. Speaks through window.speechSynthesis.

Construction never touches window. speak throws a clear error when the API is absent (Node / SSR), so a caller that reached this path without checking isSpeechSupported gets an actionable message.

Implements​

Constructors​

Constructor​

new WebSpeechSynthesizer(): WebSpeechSynthesizer

Returns​

WebSpeechSynthesizer

Methods​

cancel()​

cancel(): void

Defined in: src/audio/speechSynthesizer.ts:195

Cancel every in-flight and queued utterance.

Returns​

void

Implementation of​

SpeechSynthesizer.cancel


isSupported()​

isSupported(): boolean

Defined in: src/audio/speechSynthesizer.ts:166

Whether this synthesizer can actually speak in the current environment.

Returns​

boolean

Implementation of​

SpeechSynthesizer.isSupported


speak()​

speak(text, options): SpeechUtteranceHandle

Defined in: src/audio/speechSynthesizer.ts:170

Begin speaking text; returns a handle for timing and cancellation.

Parameters​

text​

string

options​

SpeechOptions = {}

Returns​

SpeechUtteranceHandle

Implementation of​

SpeechSynthesizer.speak