Web/API/SpeechRecognitionErrorEvent/message

From Get docs

This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.


The message read-only property of the SpeechRecognitionErrorEvent interface returns a message describing the error in more detail.

Syntax

var myErrorMsg = event.message;

Value

A DOMString containing more details about the error that was raised. Note that the spec does not define the exact wording of these messages — this is up to the implementors to decide upon.

Examples

var recognition = new SpeechRecognition();

recognition.onerror = function(event) {
  console.log('Speech recognition error detected: ' + event.error);
  console.log('Additional information: ' + event.message);
}

Specifications

Specification Status Comment
Web Speech APIThe definition of 'message' in that specification. Draft

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

message

Experimental'

Chrome

Full support 77

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

No support No

Safari

No support No

WebView Android

Full support 77

Chrome Android

Full support 77

Firefox Android

No support No

Opera Android

No support No

Safari iOS

No support No

Samsung Internet Android

Full support 12.0

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.


Firefox OS permissions

To use speech recognition in an app, you need to specify the following permissions in your manifest:

"permissions": {
  "audio-capture" : {
    "description" : "Audio capture"
  },
  "speech-recognition" : {
    "description" : "Speech recognition"
  }
}

You also need a privileged app, so you need to include this as well:

  "type": "privileged"

See also