SpeechRecognitionErrorEvent
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Giao diện SpeechRecognitionErrorEvent của Web Speech API đại diện cho các thông báo lỗi từ dịch vụ nhận dạng.
Hàm khởi tạo
SpeechRecognitionErrorEvent()-
Tạo đối tượng
SpeechRecognitionErrorEventmới.
Thuộc tính phiên bản
SpeechRecognitionErrorEvent cũng kế thừa các thuộc tính từ giao diện cha Event.
SpeechRecognitionErrorEvent.errorRead only-
Trả về loại lỗi được phát sinh.
SpeechRecognitionErrorEvent.messageRead only-
Trả về thông điệp mô tả lỗi chi tiết hơn.
Ví dụ
js
const recognition = new SpeechRecognition();
recognition.onerror = (event) => {
console.log(`Speech recognition error detected: ${event.error}`);
console.log(`Additional information: ${event.message}`);
};
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| Web Speech API> # speechrecognitionerrorevent> |