SpeechRecognitionErrorEvent: SpeechRecognitionErrorEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The SpeechRecognitionErrorEvent() constructor creates a new SpeechRecognitionErrorEvent object instance.

Syntax

js
new SpeechRecognitionErrorEvent(type, init)

Parameters

type

A string containing the name of the event. This will always be error.

init

An initialization object that contains the following properties:

error

An enumerated value representing the type of error. See the possible error values.

message Optional

A string containing more details about the error that was raised. Note that the specification does not define the exact wording of these messages — implementers must define their own wording.

Examples

You would be unlikely to construct a SpeechRecognitionErrorEvent instance manually. Such instances are available as event objects inside error event handler functions.

For example:

js
const recognition = new SpeechRecognition();

recognition.addEventListener("error", (event) => {
  console.log(`Speech recognition error detected: ${event.error}`);
  console.log(`Additional information: ${event.message}`);
});

Specifications

Specification
Web Speech API
# dom-speechrecognitionerrorevent-speechrecognitionerrorevent

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
SpeechRecognitionErrorEvent() constructor
Chrome – Full support
Chrome 33 (Release date: 2014-02-20)
altname
altname Alternate name: webkitSpeechRecognitionError
Chrome – Full support
Chrome 139 (Release date: 2025-08-05)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
altname
altname Alternate name: webkitSpeechRecognitionError
Edge – Full support
Edge 139 (Release date: 2025-08-07)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 20 (Release date: 2014-03-04)
altname
altname Alternate name: webkitSpeechRecognitionError
Opera – Full support
Opera 123 (Release date: 2025-10-28)
footnote Full support
Safari – Full support
Safari 14.1 (Release date: 2021-04-26)
footnote Full support
Chrome Android – Full support
Chrome Android 33 (Release date: 2014-02-26)
altname
altname Alternate name: webkitSpeechRecognitionError
Chrome Android – Full support
Chrome Android 139 (Release date: 2025-08-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 20 (Release date: 2014-03-06)
altname
altname Alternate name: webkitSpeechRecognitionError
Opera Android – Full support
Opera Android 91 (Release date: 2025-08-19)
footnote Full support
Safari on iOS – Full support
Safari on iOS 14.5 (Release date: 2021-04-26)
footnote Full support
Samsung Internet – Full support
Samsung Internet 2 (Release date: 2014-10-17)
altname
altname Alternate name: webkitSpeechRecognitionError
WebView Android – Full support
WebView Android 4.4.3 (Release date: 2014-06-02)
altname
altname Alternate name: webkitSpeechRecognitionError
WebView Android – Full support
WebView Android 139 (Release date: 2025-08-05)
footnote Full support
WebView on iOS – Full support
WebView on iOS 14.5 (Release date: 2021-04-26)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Uses a non-standard name
Has more compatibility info.

See also