SpeechSynthesisEvent: elapsedTime プロパティ

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.

elapsedTimeSpeechSynthesisEvent の読み取り専用プロパティで、このイベントが発生した時点での SpeechSynthesisUtterance.text を発話し始めてからの経過時間を秒単位で返します。

経過時間を秒単位で格納した浮動小数点数です。

メモ: 初期のバージョンの仕様書では、ミリ秒単位の経過時刻が必要でした。 ブラウザーの互換性一覧表を確認してください。

js
utterThis.onboundary = (event) => {
  console.log(
    `${event.name} boundary reached after ${event.elapsedTime} seconds.`,
  );
};

仕様書

Specification
Web Speech API
# dom-speechsynthesisevent-elapsedtime

ブラウザーの互換性

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
elapsedTime
elapsedTime in milliseconds
DeprecatedNon-standard

Legend

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

Full support
Full support
Partial support
Partial support
No support
No support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.

関連情報