SpeechRecognitionResult: isFinal property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The isFinal
read-only property of the
SpeechRecognitionResult
interface is a boolean value that states
whether this result is final (true
) or not (false
) — if so,
then this is the final time this result will be returned; if not, then this result is an
interim result, and may be updated later on.
Value
A boolean value.
Examples
js
recognition.onresult = (event) => {
const color = event.results[0][0].transcript;
diagnostic.textContent = `Result received: ${color}.`;
bg.style.backgroundColor = color;
console.log(event.results[0].isFinal);
};
Specifications
Specification |
---|
Web Speech API> # dom-speechrecognitionresult-isfinal> |
Browser compatibility
Loading…