Prompt

How do I use SSML with a text-to-speech API?

Artificial Intelligence / Speech & Voice AI1 observationLast seen Oct 11, 2026

Latest observation

Oct 11, 2026OpenAI APIWeb search: off

SSML (Speech Synthesis Markup Language) lets you control how a text-to-speech engine speaks your text—things like pauses, emphasis, pronunciation, rate, pitch, and volume.

Basic idea

Instead of sending plain text, you send XML-like markup:

<speak>
  Hello. <break time="500ms"/> How are you?
</speak>

The TTS API processes the SSML and generates speech accordingly.

Common SSML tags

These are widely supported, though exact support varies by provider:

  • <speak>: Root container for SSML
  • <break time="..."/>: Pause
  • <emphasis level="strong">...</emphasis>: Stress words
  • <prosody rate="slow" pitch="+2st">...</prosody>: Change speaking style
  • <say-as interpret-as="characters">TTS</say-as>: Spell out text
  • <phoneme ph="...">...</phoneme>: Control pronunciation
  • <sub alias="...">...</sub>: Replace spoken form
  • <lang xml:lang="...">...</lang>: Switch language

Example

<speak>
  <prosody rate="medium">
    Welcome to our service.
  </prosody>
  <break time="300ms"/>
  <emphasis level="moderate">Please</emphasis> review your settings.
  Your order number is <say-as interpret-as="digits">12345</say-as>.
</speak>

Typical API usage

Most TTS APIs work like this:

  1. Choose a voice/model
  2. Mark the request as SSML or provide an SSML-specific field
  3. Send the SSML text
  4. Receive audio output

Example request body

{
  "voice": "en-US-Standard-C",
  "input_type": "ssml",
  "text": "<speak>Hello <break time='300ms'/> world.</speak>"
}

Important notes

  • Your SSML must be valid XML.
  • Escape special characters like &, <, and > when they appear in normal text.
  • Not every API supports every SSML tag.
  • Some providers use slightly different syntax or have proprietary extensions.

Best practices

  • Keep markup simple unless you need fine control.
  • Test on your target voice/provider; SSML rendering can differ.
  • Use pauses and emphasis sparingly so speech still sounds natural.

If you tell me which TTS provider you’re using (Google, AWS Polly, Azure, ElevenLabs, OpenAI, etc.), I can give you the exact SSML format and an example request.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.