SpeechRecognitionErrorEvent: thuộc tính message

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 message của giao diện SpeechRecognitionErrorEvent trả về thông điệp mô tả lỗi chi tiết hơn.

Giá trị

Chuỗi chứa thêm chi tiết về lỗi đã được phát sinh. Lưu ý rằng thông số kỹ thuật không định nghĩa nội dung chính xác của các thông điệp này, điều này phụ thuộc vào quyết định của các nhà triển khai.

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
# dom-speechrecognitionerrorevent-message

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

Xem thêm