Developer tool

SSML validator

To check SSML, parse it as XML first (every tag closed, every attribute quoted, & written as &amp;), then check it against the W3C SSML 1.1 rules: <speak> as the root, only the 20 SSML elements in the places they are allowed, and attribute values in the formats the standard defines, such as time="500ms" on <break>. This validator does both and points at the line and column of every problem.

Use it from a script

The same tool answers over HTTP with no key and no account: JSON by default, Markdown for Accept: text/markdown. Limits, errors and the OpenAPI document are on the free tools API page.

curl -s https://voicelabs.now/api/tools/ssml-validator \
  -H 'Accept: text/markdown' \
  --data-urlencode 'ssml=<speak>Hello <break time="500ms"/> world</speak>'

Questions

What is SSML?
SSML (Speech Synthesis Markup Language) is the W3C's XML format for telling a text-to-speech engine how to read text: where to pause (<break>), what to stress (<emphasis>), how fast, high or loud to speak (<prosody>), how to read numbers, dates and abbreviations (<say-as>, <sub>) and how to pronounce a word (<phoneme>). The current version is SSML 1.1, a W3C Recommendation since 2010.
Why does it warn about <amazon:effect> or <mstts:express-as>?
Those are vendor extensions, not part of SSML 1.1. Amazon Polly reads amazon: tags and Microsoft Azure reads mstts: tags, but another engine may ignore them or refuse the whole request. They are reported as warnings, not errors, so you can keep them when you only target that vendor.
Do I need version, xml:lang and xmlns on <speak>?
The SSML 1.1 standard requires all three: version="1.1", an xml:lang such as "en-US", and xmlns="http://www.w3.org/2001/10/synthesis". Most engines accept a bare <speak> anyway, so their absence is a warning here, not an error.
What is the right format for a pause?
<break time="500ms"/> or <break time="1.5s"/>: a number followed by ms or s, with no space. Or use strength, one of none, x-weak, weak, medium, strong and x-strong. Engines cap how long a single break may be, and the caps differ, so check your engine for long pauses.
Is my SSML sent anywhere?
With JavaScript on, it is checked in your browser and never sent. With JavaScript off, the form sends it to the page to check it on the server; it is not stored.

VoiceLabs reads plain text in natural and cloned voices, with no SSML to write. What VoiceLabs is