SpeechSynthesis
This Web Speech API interface 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.
interface SpeechSynthesis extends EventTarget {
onvoiceschanged: ((this: SpeechSynthesis, ev: Event) => any) | null;
readonly paused: boolean;
readonly pending: boolean;
readonly speaking: boolean;
addEventListener<K extends keyof SpeechSynthesisEventMap>(
type: K,
listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;cancel(): void;
getVoices(): SpeechSynthesisVoice[];
pause(): void;
removeEventListener<K extends keyof SpeechSynthesisEventMap>(
type: K,
listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;resume(): void;
speak(utterance: SpeechSynthesisUtterance): void;
}var SpeechSynthesis: {
prototype: SpeechSynthesis;
new (): SpeechSynthesis;
};§Extends
§Properties
§
onvoiceschanged: ((this: SpeechSynthesis, ev: Event) => any) | null
[src]§Methods
§
addEventListener<K extends keyof SpeechSynthesisEventMap>(
[src]type: K,
listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void§
addEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void§
getVoices(): SpeechSynthesisVoice[]
[src]§
removeEventListener<K extends keyof SpeechSynthesisEventMap>(
[src]type: K,
listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void§
removeEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void§
speak(utterance: SpeechSynthesisUtterance): void
[src]