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

View in English Always switch to English

SpeechSynthesisEvent: utterance プロパティ

Baseline Widely available

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

utteranceSpeechSynthesisUtterance インターフェイスの読み取り専用プロパティで、イベントが発生した SpeechSynthesisUtterance インスタンスを返します。

SpeechSynthesisUtterance オブジェクトです。

js
utterThis.onpause = (event) => {
  const char = event.utterance.text.charAt(event.charIndex);
  console.log(
    `Speech paused at character ${event.charIndex} of "${event.utterance.text}", which is "${char}".`,
  );
};

仕様書

Specification
Web Speech API
# dom-speechsynthesisevent-utterance

ブラウザーの互換性

関連情報