v135 · miscellaneous

Add MediaStreamTrack support to the Web Speech API

Add MediaStreamTrack support to the Web Speech API. The Web Speech API is a web standard API that allows developers to incorporate speech recognition and synthesis into their web pages. Currently, the Web Speech API uses the user's default microphone as the audio input. MediaStreamTrack support allows websites to use the Web Speech API to caption other so

concepts

  1. Recognize from a MediaStreamTrack

    Single-track mic picker: enumerate input devices, hand the chosen one to SpeechRecognition.start(track), see live transcript.

  2. Per-participant captions in one tab

    The intent-to-ship's headline use case: a video-conferencing tab spins up one SpeechRecognition per audio track. The demo binds one recognizer to the mic and a second recognizer to a Web Audio-routed MediaStreamTrack.

  3. Live transcription bench

    Wire a mic MediaStreamTrack straight into SpeechRecognition while a parallel Web Audio analyser draws a meter from the same track. Proves both pipelines can read the same audio source.

  4. Multi-source Captions

    Two independent SpeechRecognition instances — each with a different language and its own MediaStreamTrack — running simultaneously. Captions from both merge into a shared transcript labelled by source, showing the multi-participant pattern.

  5. Processed audio transcription

    Routes mic audio through a Web Audio BiquadFilterNode (highpass, lowpass, bandpass, or notch) then feeds the processed track into SpeechRecognition. Side-by-side VU meters show raw vs filtered levels; live filter controls (cutoff, Q, gain) update in real time.

  6. Language picker

    Pick a BCP-47 language tag from a grid of 10 languages and speak — the SpeechRecognition.lang attribute is set live on the track-bound recogniser. Changing language restarts the recogniser bound to the same MediaStreamTrack, demonstrating that track binding and language selection are independent.

  7. N-participant captions

    Add up to six participant lanes dynamically. The first uses your real microphone and produces live captions; added participants use a synthetic track to show the one-SpeechRecognition-per-track pattern at scale. Demonstrates the conference call use case: peerConnection.ontrack → new lane + recogniser per remote track.

why it shipped

The Web Speech API is a web standard API that allows developers to incorporate speech recognition and synthesis into their web pages. Currently, the Web Speech API uses the user's default microphone as the audio input. Adding MediaStreamTrack support will allow websites to use the Web Speech API to caption other sources of audio including remote audio tracks.

references