MDN self-hosted library · e01.org

SpeechRecognitionResult: isFinal property

Web Speech API

Open notebook · 1 cells web-api-instance-property upstream source

Web Speech API

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

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

Browser compatibility

See also