Firefox returns SpeechSynthesisEvent.elapsedTime in milliseconds, not seconds
Categories
(Core :: Web Speech, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: micolous+moz, Assigned: m_kato)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
Steps to reproduce:
- Visit https://mdn.github.io/web-speech-api/speak-easy-synthesis/
- Add a breakpoint at line 65 of script.js:
synth.speak(utterThis);
- Select one of the system TTS voices (not Google TTS)
- Enter the text: "hello world"
- Press "play"
- When the breakpoint is hit, run the following code in the Console to log word boundary events:
utterThis.onboundary = (e) => { if (e.name == 'word') { console.log(`@ ${e.elapsedTime}: ${e.target.text.substr(e.charIndex, e.charLength)}`); }};
Actual results:
SpeechSynthesisEvent.elapsedTime
events are in milliseconds:
@ 177: Hello
@ 577: world
I also see the same issue with Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=1253036
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: https://github.com/mdn/content/issues/6581
Spec: https://wicg.github.io/speech-api/#dom-speechsynthesisevent-elapsedtime
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.
Comment 1•3 years ago
|
||
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.
Comment 2•3 years ago
|
||
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?
Assignee | ||
Comment 3•3 years ago
|
||
Yes, that's correct. Also, I guess that Windows version has same problem.
Assignee | ||
Updated•3 years ago
|
Comment 4•3 years ago
|
||
The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 5•3 years ago
|
||
Comment 7•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Updated•3 years ago
|
Comment 8•3 years ago
|
||
FYI docs work for this can be tracked in https://github.com/mdn/content/issues/10221
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.
Description
•