Skip to content

WebSpeechAPI

Types

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. See SpeechSynthesis on MDN

type speechSynthesis = {
pending: bool,
speaking: bool,
paused: bool,
}

Record fields

pending
bool
speaking
bool
paused
bool

Module

There are methods and helpers defined in SpeechSynthesis .

speechSynthesisUtterance

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.) See SpeechSynthesisUtterance on MDN

type speechSynthesisUtterance = {
mutable text: string,
mutable lang: string,
mutable voice: Null.t<speechSynthesisVoice>,
mutable volume: float,
mutable rate: float,
mutable pitch: float,
}

Record fields

text
string
lang
string
volume
float
rate
float
pitch
float

Module

There are methods and helpers defined in SpeechSynthesisUtterance .

speechSynthesisVoice

This Web Speech API interface represents a voice that the system supports. Every SpeechSynthesisVoice has its own relative speech service including information about language, name and URI. See SpeechSynthesisVoice on MDN

type speechSynthesisVoice = {
voiceURI: string,
name: string,
lang: string,
localService: bool,
default: bool,
}

Record fields

voiceURI
string
name
string
lang
string
localService
bool
default
bool