SpeechSynthesis.paused

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2018.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

SpeechSynthesis 接口的只读属性 paused 是一个 Boolean 值,当SpeechSynthesis对象处于暂停状态时,返回true ,否则返回 false

它能被设置为 暂停状态 即使当前并没有语音在播放队列中。如果utterances 被添加到语音播放队列,队列中的语音并不会播放直到使用 SpeechSynthesis.resume()使SpeechSynthesis对象处于非暂停状态。

语法

var amIPaused = speechSynthesisInstance.paused;

Value

一个Boolean

示例

js
var synth = window.speechSynthesis;

synth.pause();

var amIPaused = synth.paused; // 将返回 true

规范

Specification
Web Speech API
# dom-speechsynthesis-paused

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
paused

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

请参阅