SpeechRecognitionResult: thuộc tính isFinal
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Thuộc tính chỉ đọc isFinal của giao diện SpeechRecognitionResult là một giá trị boolean cho biết kết quả này có phải là kết quả cuối cùng (true) hay không (false). Nếu có, đây là lần cuối cùng kết quả này được trả về; nếu không, thì đây là kết quả tạm thời và có thể được cập nhật sau này.
Giá trị
Một giá trị boolean.
Ví dụ
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);
};
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| Web Speech API> # dom-speechrecognitionresult-isfinal> |