SpeechRecognition: SpeechRecognition() constructor
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The SpeechRecognition() constructor creates a new
SpeechRecognition object instance.
Syntax
js
new SpeechRecognition()
Parameters
None.
Examples
This code is excerpted from our Speech color changer example.
js
const recognition = new SpeechRecognition();
recognition.lang = "en-US";
recognition.interimResults = false;
recognition.maxAlternatives = 1;
// …
Specifications
| Specification |
|---|
| Web Speech API # dom-speechrecognition-speechrecognition |
Browser compatibility
| desktop | mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
SpeechRecognition() constructor
|
|
|
|
|
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
- Requires a vendor prefix or different name for use.
- Has more compatibility info.