このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

SpeechRecognition: speechend イベント

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

speechendウェブ音声 API のイベントで、音声認識サービスで認識された音声が検出されなくなったときに発行されます。

構文

このイベント名を addEventListener() などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。

js
addEventListener("speechend", (event) => {}); onspeechend = (event) => {}; 

イベント型

一般的な Event であり、追加のプロパティはありません。

speechend イベントは、 addEventListener メソッドで使用することができます。

js
const recognition = new webkitSpeechRecognition() || new SpeechRecognition(); recognition.addEventListener("speechend", () => { console.log("音声が検出されなくなりました"); }); 

または onspeechend イベントハンドラープロパティを使用してください。

js
recognition.onspeechend = () => { console.log("音声が検出されなくなりました"); }; 

仕様書

Specification
Web Speech API
# eventdef-speechrecognition-speechend
Web Speech API
# dom-speechrecognition-onspeechend

ブラウザーの互換性

関連情報