Skip to main content
  • What: Use SSML markup in Plivo’s <Speak> XML element to control TTS voice, pitch, volume, rate, pronunciation, and pauses. Powered by Amazon Polly (27 languages, 40+ voices)
  • How: Set voice="Polly.<VoiceName>" in your Speak tag, then use SSML tags like <prosody>, <break>, <emphasis>, <phoneme>, <say-as>
  • Cost: Currently free (beta). Will eventually be billed per character synthesized
  • Limitation: Max 3,000 characters per Speak tag. Only works with Polly voices (not legacy Plivo voices). Some Amazon Polly tags are not supported (<amazon:effect>, <amazon:auto-breaths>)
The World Wide Web Consortium (W3C) created Speech Synthesis Markup Language (SSML) as an XML-based markup language to assist in generating natural-sounding synthesized speech. The Plivo Speak XML element supports the generation of SSML-based speech, powered by Amazon Polly. It supports 27 languages and more than 40 voices, and allows developers to  control pronunciation, pitch, and volume. Here‘s how SSML appears within Plivo Speak XML elements:
To synthesize SSML speech on Plivo, specify one of the Amazon Polly voices in the voice attribute of Plivo’s <Speak> XML tag. Note that Polly voices must be namespaced with a Polly prefix. For example:

SSML tags

You can use these SSML tags within Plivo XML. Note: Plivo doesn’t support these Amazon Polly-specific tags in Plivo XML:
  • <amazon:auto-breaths>
  • <amazon:effect name=“drc”>
  • <amazon:effect phonation=“soft”>
  • <amazon:effect vocal-tract-length>
  • <amazon: effect name=“whispered”>

SSML voices

Plivo supports these Amazon Polly voices for use with Plivo XML:

Character limit

To ensure quick synthesis, Plivo caps the length of text that can be synthesized in one <Speak> tag at 3,000 characters.

Pricing

Support for SSML-based speech synthesis is currently in beta and free for all Plivo users. We expect to eventually charge for text-to-speech on the basis of the number of characters synthesized.

SSML support in Plivo Server SDKs

SSML tags are supported in all of our Server SDKs.

Example

This example use the Joey voice for US English (en-US). Use the <Speak voice> tag to specify the voice for your text.

say-as

The say-as tag describes how to interpret the text.
The rendered XML document would be:

w

The w tag lets you customize the pronunciation of a word by specifying its part of speech.
The rendered XML document would be:

More examples