Web Speech API:

Aperta
#1,458 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
css, html, javascript
Ambito
api, testing, web-dev

Direzione di ricerca

Review the Web Speech API specification and the existing WPT speech-api test suite. Start by examining the linked tests for speech synthesis and recognition to understand current coverage. The goal is to investigate API behavior, identify gaps, and propose new tests, not to write implementation code. Focus on defining testable requirements for core recognition and synthesis operations across browsers.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

investigation-effort-proposal
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.

Lingua principale
JavaScript
Stelle
591
Fork
39
Merge medio
3h 8m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di web-platform-tests/interop

Tutte le issue di web-platform-tests/interop

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.