SpeechRecognitionResult: isFinal-Eigenschaft
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die isFinal
-Eigenschaft des schreibgeschützten SpeechRecognitionResult
-Interfaces ist ein boolescher Wert, der angibt, ob dieses Ergebnis endgültig (true
) oder nicht (false
) ist — ist dies der Fall, dann ist dies das letzte Mal, dass dieses Ergebnis zurückgegeben wird; ist dies nicht der Fall, dann ist dieses Ergebnis vorläufig und kann später aktualisiert werden.
Wert
Ein boolescher Wert.
Beispiele
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);
};
Spezifikationen
Specification |
---|
Web Speech API> # dom-speechrecognitionresult-isfinal> |
Browser-Kompatibilität
Loading…