SpeechSynthesisEvent: utterance 属性
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}".`,
);
};
规范
| 规范 |
|---|
| Web Speech API # dom-speechsynthesisevent-utterance |
浏览器兼容性
加载中…