SpeechSynthesis: resume() 方法
resume() 方法是 SpeechSynthesis 介面的一部分,它將 SpeechSynthesis 物件置於非暫停狀態:如果它已被暫停,則恢復朗讀。
語法
js
resume()
引數
無。
返回值
無(undefined)。
示例
js
let synth = window.speechSynthesis;
let utterance1 = new SpeechSynthesisUtterance(
"How about we say this now? This is quite a long sentence to say.",
);
let utterance2 = new SpeechSynthesisUtterance(
"We should say another sentence too, just to be on the safe side.",
);
synth.speak(utterance1);
synth.speak(utterance2);
synth.pause(); // pauses utterances being spoken
synth.resume(); // resumes speaking
規範
| 規範 |
|---|
| Web Speech API # dom-speechsynthesis-resume |
瀏覽器相容性
載入中…