Skip to content

Web Speech API: #1458

Open
Open

Description

@BearCooder

Description

I propose an investigation of the Web Speech API covering both speech recognition, which converts speech to text, and speech synthesis, which reads text aloud to clarify behavior and build reliable tests for recognition and synthesis

The goal is to make the API's behavior clearer and establish reliable automated tests across browsers. Applications need to know when speech has started or stopped, how to cancel it, which voices or recognition capabilities are available, and how to recover when something fails.

The investigation would have two related work streams:

  • Recognition: interface and configuration checks, starting and ending sessions, stop and abort behavior, result delivery, required event relationships, and defined errors. It would also assess how audio-track input can support controlled tests. On-device language availability and installation would receive a separate requirements and automation review.
  • Synthesis: utterance configuration, voice discovery, queue handling, speak, pause, resume, cancel, reuse of utterances, and required events and errors. Tests would account for differences in installed voices and local or remote speech services.

The work would cover both halves of the API without assuming that every feature is ready for the same test approach. It would inventory the wider API, then prioritize a useful core whose behavior can be defined and tested reliably.

The first shared tests would assess browser API behavior. They would not require identical transcripts, identical voices, matching audio waveforms, or a particular recognition or synthesis speed. Advanced features such as recognition quality settings, contextual biasing, automatic punctuation, and detailed SSML handling would be recorded in the coverage map and considered separately after the core work.

Specification and existing tests

The specification is currently maintained by the Web Audio Community Group. This investigation would contribute requirements questions to the responsible standards group and testing work to WPT

Rationale

Reasons for including the feature

**Especially with AI the Web Speeech API gets a lot more use cases for a daily basis. **

Speech input and read-aloud applications need dependable controls. Dictation, voice commands, and reading tools rely on more than a successful call to start speech. A stop button, a voice selector, or an error message is only useful when the application can understand and control the session reliably.

Browser support is uneven across the two halves. Current compatibility data records broad support for speech synthesis in the major desktop browsers. Recognition support differs more: the data records Chromium support, Safari's prefixed interface, and Firefox preview support, with further differences for on-device methods. API exposure alone does not establish that an appropriate voice, language pack, or recognition service is available.

Libraries and reading projects already handle these differences. The react-speech-recognition library recommends a replacement recognition implementation for broader coverage and a more consistent experience. For synthesis, Readium's Web Speech notes document practical difficulties with voice identification, language metadata, availability, and events. This is evidence of integration work undertaken by developers. Older observations in these sources still need fresh reproduction before being treated as current browser bugs.

Existing tests provide a foundation and reveal specific gaps. WPT already has utterance defaults, synthesis start/end events, and utterance reuse tests. However, the pause/resume test is tentative because state and event timing need clarification. Recognition has an error test that does not arrange a particular failure and a manual recording test that expects an exact transcript. These are concrete starting points for better coverage and automation.

There are unresolved requirements that affect test design. Recognition issue #175 raises microphone and startup failure handling. Synthesis issue #39 and issue #40 concern state changes and event timing, while issue #35 concerns user activation. These issues remain open. Tests should not silently turn one implementation's behavior into the expected standard.

On-device recognition needs its own review. Mozilla's position is positive, while WebKit's discussion still records privacy concerns. Those discussions are specific to recognition extensions and should not be presented as positions on the whole synthesis API. The investigation should compare the concerns with today's design before proposing corresponding tests for scoring.

Activity

  1. added
    investigation-effort-proposal
    on Sep 23, 2026
  2. sushraja-msft commented on Oct 14, 2026

    @sushraja-msft

    Supportive of this effort, at the moment we do have one on device recognition specific API interop concern around processLocally attribute - https://issues.chromium.org/issues/521896368#comment4, where developers invoking webspeech once with process locally can get locked in to using on device speech for all future sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigation-effort-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions