SpeechRecognitionEvent.resultIndex
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
resultIndex
は SpeechRecognitionEvent
のインターフェイスの読み取り専用プロパティで、 SpeechRecognitionResultList
「配列」の中で最も小さな添字を結果として返します。
SpeechRecognitionResultList
オブジェクトは配列ではありませんが、配列構文でアクセスできるようにゲッターがあります。
値
数値です。
例
js
recognition.onresult = (event) => {
const color = event.results[0][0].transcript;
diagnostic.textContent = `Result received: ${color}.`;
bg.style.backgroundColor = color;
console.log(event.resultIndex); // returns 0 if there is only one result
};
仕様書
Specification |
---|
Web Speech API # dom-speechrecognitionevent-resultindex |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
resultIndex |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.