From 991def19c79ee4e0eaf50f6e49ce15a1637f5afa Mon Sep 17 00:00:00 2001 From: "Alan Ding (Google)" Date: Mon, 13 Jul 2026 21:13:22 -0700 Subject: [PATCH 1/6] Update SpeechRecognitionResult with audio timing attributes Added audioStartTime and audioEndTime attributes to SpeechRecognitionResult interface with explanations as proposed in #191 --- index.bs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/index.bs b/index.bs index e06cdf0..9d23ace 100644 --- a/index.bs +++ b/index.bs @@ -120,6 +120,8 @@ This does not preclude adding support for this as a future API enhancement, and
  • 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.
  • To mitigate the risk of fingerprinting, user agents MUST NOT personalize speech recognition when performing speech recognition on a {{MediaStreamTrack}}.
  • + +
  • 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).
  • Implementation considerations

    @@ -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 { +

    SpeechRecognitionResult Attributes

    + +
    +
    audioStartTime attribute
    +
    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.
    + +
    audioEndTime attribute
    +
    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.
    +
    +

    The group has discussed whether WebRTC might be used to specify selection of audio sources and remote recognizers. See Interacting with WebRTC, the Web Audio API and other external sources thread on public-speech-api@w3.org.

    From 34184720ca7b78958246d3de0b15f604fd142b36 Mon Sep 17 00:00:00 2001 From: "Alan Ding (Google)" Date: Thu, 13 Aug 2026 01:47:39 -0700 Subject: [PATCH 2/6] Update audio segment time references in documentation --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 9d23ace..aaf4db5 100644 --- a/index.bs +++ b/index.bs @@ -364,10 +364,10 @@ interface SpeechRecognitionPhrase {
    audioStartTime attribute
    -
    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.
    +
    A nullable {{DOMHighResTimeStamp}} representing the start of the audio segment corresponding to this recognition result, in milliseconds relative to the start of the audio stream. Returns null if the underlying recognition engine does not support audio segment start timestamps.
    audioEndTime attribute
    -
    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.
    +
    A nullable {{DOMHighResTimeStamp}} representing the end of the audio segment corresponding to this recognition result, in milliseconds relative to the start of the audio stream. Returns null if the underlying recognition engine does not support audio segment end timestamps.

    The group has discussed whether WebRTC might be used to specify selection of audio sources and remote recognizers. From 41e253ade6f2026299d2403de2c872f0af46d180 Mon Sep 17 00:00:00 2001 From: "Alan Ding (Google)" Date: Thu, 20 Aug 2026 22:01:04 -0700 Subject: [PATCH 3/6] Respond to review comments - Updated audioStartTime and audioEndTime attributes to use double type instead of nullable DOMHighResTimeStamp. - Modified descriptions to reflect the new data type and precision in seconds. - Removed specific fingerprinting mitigation requirement to leave up to each user agents' implementations. --- index.bs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.bs b/index.bs index aaf4db5..1b54f61 100644 --- a/index.bs +++ b/index.bs @@ -121,7 +121,7 @@ This does not preclude adding support for this as a future API enhancement, and

  • To mitigate the risk of fingerprinting, user agents MUST NOT personalize speech recognition when performing speech recognition on a {{MediaStreamTrack}}.
  • -
  • 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).
  • +
  • To mitigate micro-architectural timing attacks and hardware fingerprinting, user agents may reduce the resolution of {{SpeechRecognitionResult/audioStartTime}} and {{SpeechRecognitionResult/audioEndTime}} or introduce jitter, in accordance with the user agent's security and privacy policies (similar to [[HR-TIME-3]] and [[HTML]]).
  • Implementation considerations

    @@ -260,8 +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; + readonly attribute double audioStartTime; + readonly attribute double audioEndTime; }; // A collection of responses (used in continuous mode) @@ -364,10 +364,10 @@ interface SpeechRecognitionPhrase {
    audioStartTime attribute
    -
    A nullable {{DOMHighResTimeStamp}} representing the start of the audio segment corresponding to this recognition result, in milliseconds relative to the start of the audio stream. Returns null if the underlying recognition engine does not support audio segment start timestamps.
    +
    A {{double}} representing the start time of the audio segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer.
    audioEndTime attribute
    -
    A nullable {{DOMHighResTimeStamp}} representing the end of the audio segment corresponding to this recognition result, in milliseconds relative to the start of the audio stream. Returns null if the underlying recognition engine does not support audio segment end timestamps.
    +
    A {{double}} representing the end time of the audio segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer.

    The group has discussed whether WebRTC might be used to specify selection of audio sources and remote recognizers. From 2e5121de5444d82e7cb71d7c8dd16f5497f313f4 Mon Sep 17 00:00:00 2001 From: "Alan Ding (Google)" Date: Thu, 3 Sep 2026 16:47:20 -0700 Subject: [PATCH 4/6] Rename audioStartTime and audioEndTime attributes --- index.bs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.bs b/index.bs index 1b54f61..ead4b71 100644 --- a/index.bs +++ b/index.bs @@ -121,7 +121,7 @@ This does not preclude adding support for this as a future API enhancement, and

  • To mitigate the risk of fingerprinting, user agents MUST NOT personalize speech recognition when performing speech recognition on a {{MediaStreamTrack}}.
  • -
  • To mitigate micro-architectural timing attacks and hardware fingerprinting, user agents may reduce the resolution of {{SpeechRecognitionResult/audioStartTime}} and {{SpeechRecognitionResult/audioEndTime}} or introduce jitter, in accordance with the user agent's security and privacy policies (similar to [[HR-TIME-3]] and [[HTML]]).
  • +
  • To mitigate micro-architectural timing attacks and hardware fingerprinting, user agents may reduce the resolution of {{SpeechRecognitionResult/speechStartTime}} and {{SpeechRecognitionResult/speechEndTime}} or introduce jitter, in accordance with the user agent's security and privacy policies (similar to [[HR-TIME-3]] and [[HTML]]).
  • Implementation considerations

    @@ -260,8 +260,8 @@ interface SpeechRecognitionResult { readonly attribute unsigned long length; getter SpeechRecognitionAlternative? item(unsigned long index); readonly attribute boolean isFinal; - readonly attribute double audioStartTime; - readonly attribute double audioEndTime; + readonly attribute double speechStartTime; + readonly attribute double speechEndTime; }; // A collection of responses (used in continuous mode) @@ -363,11 +363,11 @@ interface SpeechRecognitionPhrase {

    SpeechRecognitionResult Attributes

    -
    audioStartTime attribute
    -
    A {{double}} representing the start time of the audio segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer.
    +
    speechStartTime attribute
    +
    A {{double}} representing the start time of the speech segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer (where 0.0 seconds corresponds to the {{SpeechRecognition/onaudiostart}} event).
    -
    audioEndTime attribute
    -
    A {{double}} representing the end time of the audio segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer.
    +
    speechEndTime attribute
    +
    A {{double}} representing the end time of the speech segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer.

    The group has discussed whether WebRTC might be used to specify selection of audio sources and remote recognizers. From e3cf78c5123a1933a261bba0dbd401733598bba6 Mon Sep 17 00:00:00 2001 From: Alan Ding Date: Thu, 10 Sep 2026 22:25:37 -0700 Subject: [PATCH 5/6] Address review comments: rebase on main, preserve nullable getter, fix audiostart event and placement --- index.bs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/index.bs b/index.bs index ead4b71..731df82 100644 --- a/index.bs +++ b/index.bs @@ -121,7 +121,7 @@ This does not preclude adding support for this as a future API enhancement, and

  • To mitigate the risk of fingerprinting, user agents MUST NOT personalize speech recognition when performing speech recognition on a {{MediaStreamTrack}}.
  • -
  • To mitigate micro-architectural timing attacks and hardware fingerprinting, user agents may reduce the resolution of {{SpeechRecognitionResult/speechStartTime}} and {{SpeechRecognitionResult/speechEndTime}} or introduce jitter, in accordance with the user agent's security and privacy policies (similar to [[HR-TIME-3]] and [[HTML]]).
  • +
  • To mitigate micro-architectural timing attacks and hardware fingerprinting, user agents MAY reduce the resolution of {{SpeechRecognitionResult/speechStartTime}} and {{SpeechRecognitionResult/speechEndTime}} or introduce jitter, in accordance with the user agent's security and privacy policies (similar to [[HR-TIME-3]] and [[HTML]]).
  • Implementation considerations

    @@ -360,16 +360,6 @@ interface SpeechRecognitionPhrase { -

    SpeechRecognitionResult Attributes

    - -
    -
    speechStartTime attribute
    -
    A {{double}} representing the start time of the speech segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer (where 0.0 seconds corresponds to the {{SpeechRecognition/onaudiostart}} event).
    - -
    speechEndTime attribute
    -
    A {{double}} representing the end time of the speech segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer.
    -
    -

    The group has discussed whether WebRTC might be used to specify selection of audio sources and remote recognizers. See Interacting with WebRTC, the Web Audio API and other external sources thread on public-speech-api@w3.org.

    @@ -680,6 +670,12 @@ For example, some implementations may fire audioe
    isFinal attribute
    The final boolean must be set to true if this is the final time the speech service will return this particular index value. If the value is false, then this represents an interim result that could still be changed.
    + +
    speechStartTime attribute
    +
    A {{double}} representing the start time of the speech segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer (where 0.0 seconds corresponds to the audiostart event).
    + +
    speechEndTime attribute
    +
    A {{double}} representing the end time of the speech segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer.

    SpeechRecognitionResultList

    From 8c38e8cce419c77b19297c90b6aaa1c12bcb364b Mon Sep 17 00:00:00 2001 From: Alan Ding Date: Wed, 16 Sep 2026 22:13:55 -0700 Subject: [PATCH 6/6] Address review: drop timestamp fuzzing bullet, clarify timeline origin Per review feedback on PR 192: Remove the security and privacy bullet permitting user agents to reduce the resolution of speechStartTime and speechEndTime. The stated rationale does not hold up: these are offsets on the session's audio timeline rather than readings of a system clock, so they do not provide the on-demand high-resolution timer that micro-architectural attacks require, and a page holding the MediaStreamTrack can already recover equivalent boundaries from the audio it has access to. Re-anchor the timeline origin. Defining 0.0 as the audiostart event tied it to when the recognizer happened to finish warming up, and left tracks sourced from an AudioContext or HTMLMediaElement undefined. The origin is now the position of the source audio at the moment the session began consuming it, matching the rule described in issue 213, so these attributes stay correct if SpeechRecognitionAudioEvent is added later. Add a non-normative note recording that these values are audio-timeline offsets unaffected by output latency or clock drift, and that their precision is implementation-defined. --- index.bs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 731df82..15091fe 100644 --- a/index.bs +++ b/index.bs @@ -120,8 +120,6 @@ This does not preclude adding support for this as a future API enhancement, and
  • 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.
  • To mitigate the risk of fingerprinting, user agents MUST NOT personalize speech recognition when performing speech recognition on a {{MediaStreamTrack}}.
  • - -
  • To mitigate micro-architectural timing attacks and hardware fingerprinting, user agents MAY reduce the resolution of {{SpeechRecognitionResult/speechStartTime}} and {{SpeechRecognitionResult/speechEndTime}} or introduce jitter, in accordance with the user agent's security and privacy policies (similar to [[HR-TIME-3]] and [[HTML]]).
  • Implementation considerations

    @@ -672,12 +670,19 @@ For example, some implementations may fire audioe If the value is false, then this represents an interim result that could still be changed.
    speechStartTime attribute
    -
    A {{double}} representing the start time of the speech segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer (where 0.0 seconds corresponds to the audiostart event).
    +
    A {{double}} representing the start of the speech segment corresponding to this recognition result, as an offset in seconds on the recognition session's audio timeline. + The origin of that timeline (0.0 seconds) is the position of the source audio at the moment the session began consuming it.
    speechEndTime attribute
    -
    A {{double}} representing the end time of the speech segment corresponding to this recognition result, in seconds relative to the start of the audio stream consumed by the speech recognizer.
    +
    A {{double}} representing the end of the speech segment corresponding to this recognition result, as an offset in seconds on the same timeline as {{SpeechRecognitionResult/speechStartTime}}.
    +

    + {{SpeechRecognitionResult/speechStartTime}} and {{SpeechRecognitionResult/speechEndTime}} are offsets on the recognition session's audio timeline, not readings of a system clock. + They are therefore unaffected by audio output latency or by drift between an audio device clock and the system clock, and are identical whether recognition runs in real time or faster than real time. + Their precision is implementation-defined and is in practice bounded by the frame size of the underlying recognizer. +

    +

    SpeechRecognitionResultList

    The SpeechRecognitionResultList object holds a sequence of recognition results representing the complete return result of a continuous recognition.