> For the complete documentation index, see [llms.txt](https://atlas.anywhere.now/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atlas.anywhere.now/product-reference/dialogue-studio/dialogue-studio-example-flows/configure-ssml.md).

# Configure SSML

Build a flow in Dialogue Studio that generates SSML markup in a function node and plays it with the Say node's SSML method.

This example builds spoken output using Speech Synthesis Markup Language (SSML). SSML is an XML-based markup language for speech synthesis that lets you control pauses, pronunciation, emphasis, and multi-language speech. There is no importable flow for this example: build it node by node as described below.

## What it does

A function node builds an SSML string and a Say node plays it using the SSML method instead of plain text, producing controlled pauses, spelled-out characters, cardinal and ordinal numbers, phrase substitution, multi-language sentences, a spoken date, and emphasis.

## Prerequisites

* A UCC configured with Dialogue Studio and a speech engine configured for text-to-speech.
* Confirm which speech engine your UCC uses, because the supported SSML tags differ by engine:
  * Microsoft Text to Speech: see [Microsoft Learn - Speech Synthesis Markup Language reference](https://learn.microsoft.com/en-us/previous-versions/office/developer/speech-technologies/hh378377\(v=office.14\))
  * Microsoft Cognitive Services (Azure AI Speech): see [Speech Synthesis Markup Language (SSML) overview](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/speech-synthesis-markup?tabs=csharp)
  * Google Cloud Text to Speech: see [SSML reference](https://developers.google.com/assistant/actions/reference/ssml#markupSSML)

## Preview

![SSML flow](https://2627137428-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FscZpnEdBjDgQmlVn1iLr%2Fuploads%2Fgit-blob-ba6f442e8ec4966d5e25a6f6a3a8e4ddbc813959%2Fssml.png?alt=media)

## Build the flow

### 1. Incoming Call node

Drag and drop an Incoming Call node. Open it and select or configure your server, and filter on audio/video.

### 2. Function node

Drag and drop a Function node and connect it to the end of the Incoming Call node. Set `msg.text` to the SSML string you want to play. Example for Microsoft Text to Speech:

```javascript
msg.text = '<p>\
<s xml:lang="en-EN">\
Here are <say-as interpret-as="characters">SSML</say-as> samples.\
I can pause <break time="1s"/>. \
I can speak in cardinals. \
Your number is <say-as interpret-as="cardinal">10</say-as>. \
Or I can speak in ordinals.\
You are <say-as interpret-as="ordinal"> 10 </say-as> in line.\
Or I can even speak in digits.\
The digits for ten are <say-as interpret-as="characters"> 10 </say-as>.\
I can also substitute phrases, like the <sub alias="World Wide Web Consortium"> W3C </sub>.\
Finally, I can speak a paragraph with in multiple languages.\
</s>\
</p>\
<p>\
<s xml:lang="en-EN">I can speak english</s>\
<s xml:lang="nl-NL">Ik kan nederlands spreken.</s>\
<s xml:lang="de-DE">Ich kann Deutsch sprechen</s>\
</p>\
<p>\
Today is <say-as type="date:mdy"> 11/20/2019 </say-as> \
I <emphasis level="strong">really</emphasis> like pepperoni on my pizza.\
</p>'
return msg;
```

### 3. Say node

Drag and drop a Say node and connect it to the end of the Function node. Set the message to `msg.text` and set the method to **SSML**.

## How the flow works

* The Incoming Call node accepts an audio/video session.
* The Function node builds the SSML-tagged string and stores it on `msg.text`.
* The Say node plays `msg.text` using the SSML method instead of the default text-to-speech method, so the tags in the string (pauses, `say-as`, `sub`, `emphasis`, language switches) are interpreted by the speech engine instead of being read aloud literally.

## Safe fallback behavior

This example has no error branch of its own because it is a demonstration of markup, not a full call flow. If you use SSML output in a production flow, add a [catch node](/product-reference/dialogue-studio/dialogue-studio-example-flows/configure-catch-node.md) around the Say node so a malformed SSML string (for example an unclosed tag) does not silently halt the flow.

## Verification

1. Call the UCC and confirm the SSML sample plays with an audible pause, spelled-out digits, a cardinal number, an ordinal number, the substituted phrase, the three language sentences, the spoken date, and the emphasized word.
2. If the output sounds like the raw tags are being read aloud, confirm the Say node's method is set to SSML and that the SSML dialect matches your configured speech engine.

## Related topics

* Go to [Configure a catch node](/product-reference/dialogue-studio/dialogue-studio-example-flows/configure-catch-node.md) to add error handling around a Say node that plays SSML.
* Go to [Dialogue Studio example flows](/product-reference/dialogue-studio/dialogue-studio-example-flows.md) for the full gallery of example flows.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://atlas.anywhere.now/product-reference/dialogue-studio/dialogue-studio-example-flows/configure-ssml.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
