v153 · speechrecognitionresult timestamps

Caption timeline mapper

A captioning or transcript-scrubbing tool needs to know where each phrase sits in the audio. With audioStartTime and audioEndTime you can position every recognised segment on a timeline — the foundation for click-to-seek transcripts, karaoke-style highlighting, and aligning captions to a media element.

To read real timestamps: you need a build that implements the proposal (PR #192, unmerged; the v153 listing records a developer trial at 153, but the attributes are not yet in Chromium main's IDL as of 2026-07-24 and no dedicated runtime flag exists yet) plus a timing-capable recognition backend. When a result's audioStartTime / audioEndTime are null, its caption is still shown but flagged as unpositioned — never dropped onto the timeline at a made-up spot. The sample walkthrough renders a fully-timed transcript.

Recognised phrases on an audio timeline

0.00 s— s

Caption list

  1. No captions yet. Start listening, or play the sample.

code path

recognition.onresult = (event) => {
  const result = event.results[event.resultIndex];
  if (!result.isFinal) return;
  const start = result.audioStartTime, end = result.audioEndTime;   // ms | null
  if (start == null || end == null) { listUnpositioned(result[0].transcript); return; }
  addSegment(result[0].transcript, start, end);   // left = start / total, width = (end - start) / total
};

see also