SpeechRecognition: audioend イベント
audioend はウェブ音声 API のイベントで、ユーザーエージェントが音声認識のためのオーディオキャプチャを終了したときに発生します。
構文
このイベント名を addEventListener() などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。
js
addEventListener('audioend', (event) => { })
onaudioend = (event) => { }
イベント型
一般的な Event であり、追加のプロパティはありません。
例
audioend イベントは、 addEventListener メソッドで使用することができます。
js
const recognition = new webkitSpeechRecognition() || new SpeechRecognition();
recognition.addEventListener('audioend', () => {
console.log('音声認識が終了しました。');
});
または onaudioend イベントハンドラープロパティを使用してください。
js
recognition.onaudioend = () => {
console.log('Audio capturing ended');
}
仕様書
| Specification |
|---|
| Web Speech API # eventdef-speechrecognition-audioend |
| Web Speech API # dom-speechrecognition-onaudioend |
ブラウザーの互換性
BCD tables only load in the browser