Closed Bug 1732498 Opened 3 years ago Closed 3 years ago

Firefox returns SpeechSynthesisEvent.elapsedTime in milliseconds, not seconds


(Core :: Web Speech, defect)

Firefox 92



95 Branch
Tracking Status
firefox95 --- fixed


(Reporter: micolous+moz, Assigned: m_kato)


(Keywords: dev-doc-complete)


(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0

Steps to reproduce:

  1. Visit
  2. Add a breakpoint at line 65 of script.js: synth.speak(utterThis);
  3. Select one of the system TTS voices (not Google TTS)
  4. Enter the text: "hello world"
  5. Press "play"
  6. When the breakpoint is hit, run the following code in the Console to log word boundary events:
utterThis.onboundary = (e) => { if ( == 'word') { console.log(`@ ${e.elapsedTime}: ${, e.charLength)}`); }};

Actual results:

SpeechSynthesisEvent.elapsedTime events are in milliseconds:

@ 177: Hello
@ 577: world

I also see the same issue with Chrome:

Expected results:

SpeechSynthesisEvent.elapsedTime events should be in seconds, eg:

@ 0.17: Hello
@ 0.57: world

MDN's documentation erroneously stated the event was in milliseconds, which has been corrected:


elapsedTime attribute, of type float, readonly
This attribute indicates the time, in seconds, that this event triggered, relative to when this utterance has begun to be spoken.

Safari 14.1.2 on macOS appears to have correct behaviour.

Summary: SpeechSynthesisEvent.elapsedTime in milliseconds, not seconds → Firefox returns SpeechSynthesisEvent.elapsedTime in milliseconds, not seconds

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

m_kato, it looks to me like the fix here would be in changing duration.ToSeconds() in SpeechTaskCallback::GetTimeDurationFromStart here, but that's platform-specific code, and I'm not able to find the corresponding places to change for other platforms. Do you have any idea?

Severity: -- → S4
Flags: needinfo?(m_kato)
Priority: -- → P5

Yes, that's correct. Also, I guess that Windows version has same problem.

Assignee: nobody → m_kato
Component: Audio/Video: Playback → Web Speech
Flags: needinfo?(m_kato)
Ever confirmed: true

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.

Priority: P5 → --
Pushed by
Duration of nsISpeechTask should be second. r=eeejay
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
Keywords: dev-doc-needed

FYI docs work for this can be tracked in

In summary it is the addition of a subfeature in browser compatibility to track removal of milliseconds, and the docs have been updated with a note to check the compatibility table. There is also a release note.

You need to log in before you can comment on or make changes to this bug.