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.

Event SpeechRecognitionErrorEvent

Hàm khởi tạo

SpeechRecognitionErrorEvent()

Tạo đối tượng SpeechRecognitionErrorEvent mớ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.error Read only

Trả về loại lỗi được phát sinh.

SpeechRecognitionErrorEvent.message Read 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

Tương thích trình duyệt

Xem thêm