web api instance property
SpeechRecognition: maxAlternatives property
The maxAlternatives property of the
SpeechRecognition interface sets the maximum number of
SpeechRecognitionAlternatives provided per
SpeechRecognitionResult.
The default value is 1.
Value
A number representing the maximum returned alternatives for each result.
Examples
This code is excerpted from our Speech color changer example.
const recognition = new SpeechRecognition();
recognition.lang = "en-US";
recognition.interimResults = false;
recognition.maxAlternatives = 1;
// …
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.