Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/index.ts>dom.SpeechSynthesisUtterance

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.SpeechSynthesisUtterance
implements EventTarget
import { type dom } from "https://deno.land/x/evt@v2.4.22/lib/index.ts";
const { SpeechSynthesisUtterance } = dom;

This Web Speech API interface 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.)

Properties

lang: string
onboundary: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null
onend: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null
onerror: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisErrorEvent) => any) | null
onmark: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null
onpause: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null
onresume: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null
onstart: ((this: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) => any) | null
pitch: number
rate: number
text: string
voice: SpeechSynthesisVoice | null
volume: number

Methods

addEventListener<K extends keyof SpeechSynthesisUtteranceEventMap>(
type: K,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof SpeechSynthesisUtteranceEventMap>(
type: K,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void