このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

SpeechSynthesis: pause() メソッド

Baseline Widely available

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

pause()SpeechSynthesis インターフェイスのメソッドで、SpeechSynthesis オブジェクトを一時停止状態にします。

構文

js
pause()

引数

なし。

返値

なし (undefined)。

js
const synth = window.speechSynthesis;

const utterance1 = new SpeechSynthesisUtterance(
  "こう言ってみてはどうでしょうか?これを言うと、かなり長い文章になります。",
);
const utterance2 = new SpeechSynthesisUtterance("念のため、もう一言言います。");

synth.speak(utterance1);
synth.speak(utterance2);

synth.pause(); // 発話を停止

仕様書

Specification
Web Speech API
# dom-speechsynthesis-pause

ブラウザーの互換性

関連情報