blob: f94637a8d21eb8a5940ce5ddfb6f6ca1af52f289 [file] [log] [blame]
// Content was automatically extracted by Reffy into reffy-reports
// (
// Source: Web Speech API (
[Exposed=Window, Constructor]
interface SpeechRecognition : EventTarget {
// recognition parameters
attribute SpeechGrammarList grammars;
attribute DOMString lang;
attribute boolean continuous;
attribute boolean interimResults;
attribute unsigned long maxAlternatives;
attribute DOMString serviceURI;
// methods to drive the speech interaction
void start();
void stop();
void abort();
// event methods
attribute EventHandler onaudiostart;
attribute EventHandler onsoundstart;
attribute EventHandler onspeechstart;
attribute EventHandler onspeechend;
attribute EventHandler onsoundend;
attribute EventHandler onaudioend;
attribute EventHandler onresult;
attribute EventHandler onnomatch;
attribute EventHandler onerror;
attribute EventHandler onstart;
attribute EventHandler onend;
enum SpeechRecognitionErrorCode {
Constructor(DOMString type, SpeechRecognitionErrorEventInit eventInitDict)]
interface SpeechRecognitionErrorEvent : Event {
readonly attribute SpeechRecognitionErrorCode error;
readonly attribute DOMString message;
dictionary SpeechRecognitionErrorEventInit : EventInit {
required SpeechRecognitionErrorCode error;
DOMString message = "";
// Item in N-best list
interface SpeechRecognitionAlternative {
readonly attribute DOMString transcript;
readonly attribute float confidence;
// A complete one-shot simple response
interface SpeechRecognitionResult {
readonly attribute unsigned long length;
getter SpeechRecognitionAlternative item(unsigned long index);
readonly attribute boolean isFinal;
// A collection of responses (used in continuous mode)
interface SpeechRecognitionResultList {
readonly attribute unsigned long length;
getter SpeechRecognitionResult item(unsigned long index);
// A full response, which could be interim or final, part of a continuous response or not
Constructor(DOMString type, SpeechRecognitionEventInit eventInitDict)]
interface SpeechRecognitionEvent : Event {
readonly attribute unsigned long resultIndex;
readonly attribute SpeechRecognitionResultList results;
readonly attribute any interpretation;
readonly attribute Document? emma;
dictionary SpeechRecognitionEventInit : EventInit {
unsigned long resultIndex = 0;
required SpeechRecognitionResultList results;
any interpretation = null;
Document? emma = null;
// The object representing a speech grammar
[Exposed=Window, Constructor]
interface SpeechGrammar {
attribute DOMString src;
attribute float weight;
// The object representing a speech grammar collection
[Exposed=Window, Constructor]
interface SpeechGrammarList {
readonly attribute unsigned long length;
getter SpeechGrammar item(unsigned long index);
void addFromURI(DOMString src,
optional float weight);
void addFromString(DOMString string,
optional float weight);
interface SpeechSynthesis : EventTarget {
readonly attribute boolean pending;
readonly attribute boolean speaking;
readonly attribute boolean paused;
attribute EventHandler onvoiceschanged;
void speak(SpeechSynthesisUtterance utterance);
void cancel();
void pause();
void resume();
sequence<SpeechSynthesisVoice> getVoices();
partial interface Window {
[SameObject] readonly attribute SpeechSynthesis speechSynthesis;
Constructor(optional DOMString text)]
interface SpeechSynthesisUtterance : EventTarget {
attribute DOMString text;
attribute DOMString lang;
attribute SpeechSynthesisVoice? voice;
attribute float volume;
attribute float rate;
attribute float pitch;
attribute EventHandler onstart;
attribute EventHandler onend;
attribute EventHandler onerror;
attribute EventHandler onpause;
attribute EventHandler onresume;
attribute EventHandler onmark;
attribute EventHandler onboundary;
Constructor(DOMString type, SpeechSynthesisEventInit eventInitDict)]
interface SpeechSynthesisEvent : Event {
readonly attribute SpeechSynthesisUtterance utterance;
readonly attribute unsigned long charIndex;
readonly attribute float elapsedTime;
readonly attribute DOMString name;
dictionary SpeechSynthesisEventInit : EventInit {
required SpeechSynthesisUtterance utterance;
unsigned long charIndex = 0;
float elapsedTime = 0;
DOMString name = "";
enum SpeechSynthesisErrorCode {
Constructor(DOMString type, SpeechSynthesisErrorEventInit eventInitDict)]
interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent {
readonly attribute SpeechSynthesisErrorCode error;
dictionary SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit {
required SpeechSynthesisErrorCode error;
interface SpeechSynthesisVoice {
readonly attribute DOMString voiceURI;
readonly attribute DOMString name;
readonly attribute DOMString lang;
readonly attribute boolean localService;
readonly attribute boolean default;