charLength in SpeechSynthesisEvent
- Category
- Miscellaneous
- Type
- New or changed feature
- Status
- In development (Chrome In development)
- Intent stage
- Start prototyping
WPT details: https://wpt.fyi/results/speech-api/SpeechSynthesisEvent-constructor.html?label=master&product=chrome%5Bexperimental%5D&product=edge&product=firefox%5Bexperimental%5D&product=safari%5Bexperimental%5D&aligned The related tests are: SpeechSynthesisEvent with eventInitDict having an utterance SpeechSynthesisEvent with custom eventInitDict
Summary
Adds the charLength attribute to the SpeechSynthesisEvent in the Web Speech API, which is fired every time a word is spoken in text to speech applications. The charLength length allows developers to get the length, in characters, of the word that is about to be spoken.
Motivation
Currently, developers resort to third-party libraries or error-prone, self-rolled code for getting word length in text to speech applications. OS text to speech engines already expose this functionality, so this feature will reduce code bloat and complexity for web developers if we expose this functionality to them.
Standards & signals
- Specification: https://w3c.github.io/speech-api/
- Firefox: No signal
- Safari: No signal
- Web developers: Positive
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=923556
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=speech-api%2FSpeechSynthesisEvent-constructor
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+charLength%20in%20SpeechSynthesisEvent
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=charLength%20in%20SpeechSynthesisEvent
- Baseline status: https://webstatus.dev/?q=charLength%20in%20SpeechSynthesisEvent
Docs: https://github.com/w3c/speech-api/pull/50 https://github.com/web-platform-tests/wpt/pull/15732
Explainers: https://github.com/w3c/speech-api/issues/51 https://stackoverflow.com/questions/32961008/split-chinese-characters