Support message text-to-speech through browser.SpeechSynthesis
API
#19149
Labels
A11y
A-Timeline
O-Uncommon
Most users are unlikely to come across this or unexpected workflow
T-Enhancement
Your use case
What would you like to do?
I would like native support for text-to-speech playback of incoming text messages in the Element client.
Why would you like to do it?
I am legally blind. Text-to-speech helps me (and other people with print disabilities) keep up with chat.
How would you like to achieve it?
Element is a web app, which means it has access to the
[browser.SpeechSynthesis API](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis)
. TL;DR the API allows web pages to pass text along to whatever TTS engine is installed on the user's machine, and the OS does the rest.You can see a working example on Discord. To enable TTS on Discord for all incoming messages, go to the User Menu -> Accessibility.
Have you considered any alternatives?
Screen readers can theoretically be used to read incoming chat, but practically this is almost impossible. A solution native to the client is best because:
Additional context
I note that element-hq/element-meta#1626 suggested a specific /tts command for TTS playback of certain messages. While this has its uses (and nuisances), my suggestion is for client-side TTS playback rather than a /tts command.
The text was updated successfully, but these errors were encountered: