SpeechSynthesis: paused 属性

Baseline 已广泛支持

此功能已成熟,并可在多种设备和浏览器版本上使用。自 2018 年 9 月以来,它已在各种浏览器中推出。

pausedSpeechSynthesis 接口的一个只读布尔属性。如果 SpeechSynthesis 对象处于暂停状态,它返回 true,否则返回 false

即使当前没有通过它播放任何内容,也可以将其设置为 paused。如果随后将 utterances 添加到话语队列中,在不使用 SpeechSynthesis.resume() 解除 SpeechSynthesis 对象的暂停之前,它们将不会被播放。

一个布尔值。

示例

js
const synth = window.speechSynthesis;

synth.pause();

const amIPaused = synth.paused; // will return true

规范

规范
Web Speech API
# dom-speechsynthesis-paused

浏览器兼容性

另见