SpeechSynthesis.paused
SpeechSynthesis
接口的只读属性 paused
是一个 Boolean
(en-US) 值,当SpeechSynthesis
对象处于暂停状态时,返回true
,否则返回 false
。
它能被设置为 暂停状态
(en-US) 即使当前并没有语音在播放队列中。如果utterances
(en-US) 被添加到语音播放队列,队列中的语音并不会播放直到使用 SpeechSynthesis.resume()
(en-US)使SpeechSynthesis
对象处于非暂停状态。
语法
var amIPaused = speechSynthesisInstance.paused;
Value
示例
js
var synth = window.speechSynthesis;
synth.pause();
var amIPaused = synth.paused; // 将返回 true
规范
Specification |
---|
Web Speech API # dom-speechsynthesis-paused |
浏览器兼容性
BCD tables only load in the browser