← Back to release summary

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

Ecosystem

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

View on chromestatus.com