Speech synthesis (text to speech)
Speaks text aloud with the device's voices; needs a prior interaction.
In one line
Can speak text out loud, after you have tapped on the page
Speaks text aloud with the device's voices; needs a prior interaction.
A site can read text out loud with built-in voices. The voice list differs by device, so it also hints at the OS, language packs and installed software.
What it can and can't do
What the user does: You tap Listen or Play aloud, or tap the page before it speaks.
It can
- Speak text out loud using voices on your device
- Pause, resume or stop the voice
- Pick a voice from the ones on your device
It cannot
- Speak the moment a page loads, before you have tapped or clicked
- Record you or hear what you say
- Use voices you do not have on your device
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 33 | 2014-02-20 | None |
| Edge | Supported | 14 | 2016-08-02 | None |
| Firefox | Supported | 49 | 2016-09-20 | None |
| Safari | Supported | 7 | 2013-10-22 | None |
| Safari on iPhone | Supported | 7 | 2013-09-18 | All iOS browsers use WebKit |
| Chrome on Android | Supported | 33 | 2014-02-26 | None |
| Samsung Internet | Supported | 3.0 | 2015-04-10 | None |
How a site asks for it
| API | speechSynthesis.speak(new SpeechSynthesisUtterance(text)); getVoices() |
| Browser compat keys | api.SpeechSynthesis.speakapi.SpeechSynthesis.getVoices |
| How access is granted | gesture |
| What the user sees | No prompt (needs a click, tap or keypress) |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | Yes |
| Activation | sticky |
| How long it lasts | Voices list fixed per OS; queue lasts for the page |
| How to take it back | Nothing to revoke (no permission is stored) |
| Inside an iframe | Cross-origin iframes need allow="autoplay"-like activation in that frame |
Typical flow
- Person interacts with the page (sticky)
- Page calls speak()
- Device plays the voice
Data you get
Shape: none
No individual data fields. The signal is the access itself.
Technical limits
- Chrome 71 requires user activation on the page before speak() produces sound
- Utterance rate 0.1 to 10, pitch 0 to 2, volume 0 to 1
- Network voices in Chrome (Google voices) historically stop after about 15 s of speech (known issue)
- Cannot record the output or pick voices not installed
- Voice list and default voice leak OS and language (fingerprint)
The story
What it is
A page can read text out loud with your device's voices.
For you
You tap a Listen button and a voice reads an article or a language lesson. The browser blocks a page from talking before you have touched it.
For makers
Makers use it for accessibility, language apps and hands free reading. It costs them nothing because the device does the voice work.
Where you see it
| Type | Example | Apps |
|---|---|---|
| education | A language app reads a Spanish word aloud so you can hear the accent. | Duolingo, Google Translate |
| news | A news site offers a Listen to this article button. | Medium |
| accessibility | A screen reading tool speaks page text for people with low vision or dyslexia. | None named |
| games | A browser game has a robot narrator reading dialog out loud. | None named |
| productivity | A web note app reads your note back to you while you cook. | None named |
| kids | A children's reading site speaks each word as the child taps it. | None named |
Risks
- Sudden noise
- Voice list can identify a device
What the platform says
- Mozilla: Web Speech API. MDN says speech synthesis lets pages read text aloud with the voices on your device.
Good uses and abuse
Legitimate uses
- Accessibility readers
- Language learning
- Audio notifications
Known abuse
- Voice list fingerprinting
- Unexpected audio
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | 3 | Rough identifying entropy, when known |
History
- 2016-04, Chrome 47: Remote voices exposed through getVoices
- 2018-12, Chrome 71: speak() requires user activation
Sources
How well checked: Based on official documentation.