SpeechSynthesisEvent: utterance プロパティ
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2022年9月.
utterance は SpeechSynthesisUtterance インターフェイスの読み取り専用プロパティで、イベントが発生した SpeechSynthesisUtterance インスタンスを返します。
値
SpeechSynthesisUtterance オブジェクトです。
例
js
utterThis.onpause = (event) => {
const char = event.utterance.text.charAt(event.charIndex);
console.log(
`Speech paused at character ${event.charIndex} of "${event.utterance.text}", which is "${char}".`,
);
};
仕様書
| Specification |
|---|
| Web Speech API> # dom-speechsynthesisevent-utterance> |
ブラウザーの互換性
Loading…