Update SpeechRecognitionResult with audio timing attributes#192
Open
alan33d wants to merge 1 commit into
Open
Conversation
Added audioStartTime and audioEndTime attributes to SpeechRecognitionResult interface with explanations as proposed in WebAudio#191
hoch
reviewed
Jul 14, 2026
|
|
||
| <dl> | ||
| <dt><dfn attribute for=SpeechRecognitionResult>audioStartTime</dfn> attribute</dt> | ||
| <dd>A nullable {{DOMHighResTimeStamp}} representing the start of the audio segment corresponding to this recognition result, in milliseconds relative to the time origin. Returns null if the underlying recognition engine does not support audio segment start timestamps.</dd> |
Member
There was a problem hiding this comment.
IIRC SpeechSynthesisEvent uses elapsedTime, which is float.
Is there a specific design reason for using DOMHighResTimeStamp here?
Collaborator
Author
There was a problem hiding this comment.
No specific reason, I started with double? but it was suggested by @evanbliu to use DOMHighResTimeStamp? to mirror event.timeStamp property. I don't have a strong preference on this.
Collaborator
There was a problem hiding this comment.
IIUC, DOMHighResTimeStamp is just a typedef for a double but it makes it clear that the units are in milliseconds.
I assume SpeechSynthesisEvent uses float because DOMHighResTimeStamp didn't exist (or at least wasn't widely adopted) back in 2012.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added audioStartTime and audioEndTime attributes to SpeechRecognitionResult interface with explanations as proposed in #191.
Fixes: #191
Preview | Diff