-
Notifications
You must be signed in to change notification settings - Fork 39
Update SpeechRecognitionResult with audio timing attributes #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alan33d
wants to merge
1
commit into
WebAudio:main
Choose a base branch
from
alan33d:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+14
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,6 +120,8 @@ This does not preclude adding support for this as a future API enhancement, and | |
| <li>The user agent may also give the user a longer explanation the first time speech input is used, to let the user know what it is and how they can tune their privacy settings to disable speech recording if required.</li> | ||
|
|
||
| <li>To mitigate the risk of fingerprinting, user agents MUST NOT personalize speech recognition when performing speech recognition on a {{MediaStreamTrack}}.</li> | ||
|
|
||
| <li>To mitigate fingerprinting vectors associated with high-precision timing, user agents MUST apply timestamp fuzzing and precision reduction to {{SpeechRecognitionResult/audioStartTime}} and {{SpeechRecognitionResult/audioEndTime}} before exposing these attributes to scripts (e.g. by rounding to 2ms precision).</li> | ||
| </ol> | ||
|
|
||
| <h3 id="implementation-considerations">Implementation considerations</h3> | ||
|
|
@@ -258,6 +260,8 @@ interface SpeechRecognitionResult { | |
| readonly attribute unsigned long length; | ||
| getter SpeechRecognitionAlternative item(unsigned long index); | ||
| readonly attribute boolean isFinal; | ||
| readonly attribute DOMHighResTimeStamp? audioStartTime; | ||
| readonly attribute DOMHighResTimeStamp? audioEndTime; | ||
| }; | ||
|
|
||
| // A collection of responses (used in continuous mode) | ||
|
|
@@ -356,6 +360,16 @@ interface SpeechRecognitionPhrase { | |
| </dd> | ||
| </dl> | ||
|
|
||
| <h4 id="speechrecoresult-attributes">SpeechRecognitionResult Attributes</h4> | ||
|
|
||
| <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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC Is there a specific design reason for using DOMHighResTimeStamp here? |
||
|
|
||
| <dt><dfn attribute for=SpeechRecognitionResult>audioEndTime</dfn> attribute</dt> | ||
| <dd>A nullable {{DOMHighResTimeStamp}} representing the end 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 end timestamps.</dd> | ||
| </dl> | ||
|
|
||
| <p class=issue>The group has discussed whether WebRTC might be used to specify selection of audio sources and remote recognizers. | ||
| See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Sep/0072.html">Interacting with WebRTC, the Web Audio API and other external sources</a> thread on public-speech-api@w3.org.</p> | ||
|
|
||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious what these timestamps mean when
isFinalisfalse.For example, when an interim result is updated with more speech (e.g., 'hello' becomes 'hello world'), does audioEndTime update dynamically? Does audioStartTime remain stable for the duration of that interim result's lifecycle?