From 04a8f241fc8ccff87a873be28f2b0c3b893bca2a Mon Sep 17 00:00:00 2001 From: "Alan Ding (Google)" Date: Mon, 13 Jul 2026 21:13:22 -0700 Subject: [PATCH] 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 15694a5..5b5da91 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.