mdn / mdn/browser-compat-data

api.SpeechSynthesisUtterance.text - SSML Support does not work on all platforms

Open
#15,663 3 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

browser:multiple data:api meeting agenda
Dominant language
JSON
Stars
5.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
186

Description

What information was incorrect, unhelpful, or incomplete?

The text property of the SpeechSynthesisUtterance interface gets and sets the text that will be synthesized when the utterance is spoken.

The text may be provided as plain text, or a well-formed SSML document. The SSML tags will be stripped away by devices that don't support SSML.

The Web Speech API specifies that the text property given to a SpeechSynthesisUtterance can be either the text to read out, or an SSML string which will be stripped by devices that don't support SSML. Based off reading https://github.com/WICG/speech-api/issues/37 this behaviour is not supported by any major browser. As quoted below:

Implementation bugs:

The result of this bug is that on platforms that don't support SSML (particularly macOS) the SSML is read out as if it is text, rather than being stripped.

The Browser Compatibility table specifies that many browsers have full support for this API, when actually they do not.

What did you expect to see?

I expected to see a *, flag, or comment on the Browser Compatibility table for this page which highlights that this spec is not fully implemented in all browsers. Or to mention that it has bugs around SSML support.

Alternatively the extra information about SSML support could be removed from the documentation if it seems like no browser is likely to ever implement this behaviour.

Did you test this? If so, how?

A simple test can be done on Safari, Firefox or Chrome for macOS:

const utterance = new SpeechSynthesisUtterance('<speak>hello</speak>');
speechSynthesis.speak(utterance);

What is expected is that the SpeechSynthesis simply says "hello", but instead it will say "speak hello speak".

MDN page report details

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MDN SpeechSynthesisUtterance.text page and its Browser Compatibility table, then review the linked Chromium, Edge, Gecko, WebKit, and WICG reports. Done means accurately flagging the SSML limitation in compatibility data or revising the SSML documentation based on the verified implementation status.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.