> ## Documentation Index
> Fetch the complete documentation index at: https://www.vobiz.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Speak XML Element: Text-to-Speech on Live Calls

> Convert text to speech in a live call with the Vobiz Speak element. Choose voices and languages, set loop count, and drive dynamic IVR prompts worldwide.

The `Speak` element converts text to speech (TTS) and plays it to the caller. The text to read is the element's content; voice, language, and loop count are set as attributes. `Speak` runs to completion before Vobiz moves to the next element, and posts no parameters of its own to any URL.

## Attributes

| Attribute | Description |
| - | - |
| `voice`  *string* | The voice used to read the text.  **Allowed values:** WOMAN, MAN, or `Polly.<Name>` from the [Polly voice list](https://www.vobiz.ai/docs/xml/speak/ssml.md#polly-voices)  Defaults to WOMAN. |
| `language`  *string* | Language used to read the text.  **Allowed values:** See the "Supported voices and languages" table below.  Defaults to en-US. Applies to `WOMAN` and `MAN`; a Polly voice uses its own language. |
| `loop`  *integer* | Number of times to speak the text. Set to 0 to repeat up to 500 times.  **Allowed values:** integer >= 0 (0 repeats up to 500 times)  Defaults to 1. |

## Nesting rules

`Speak` takes plain text as its content. To use [SSML](https://www.vobiz.ai/docs/xml/speak/ssml.md) markup, set `voice` to a `Polly.<Name>` voice. `Speak` holds text or SSML, and other verbs sit alongside it. You can nest `Speak` inside [`Gather`](https://www.vobiz.ai/docs/xml/gather) (to prompt for input) and [`PreAnswer`](https://www.vobiz.ai/docs/xml/preanswer) (to speak before answering).

## Examples

### Speak a basic message

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak>Thank you for calling. Please hold while we connect you.</Speak>
</Response>
```

### Choose a voice and language

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak voice="MAN" language="en-GB">Welcome to our London office.</Speak>
</Response>
```

### Use a Polly voice

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak voice="Polly.Joanna">Welcome to our support line.</Speak>
</Response>
```

### Repeat a message in a loop

Set `loop` to repeat an announcement. Use `loop="0"` to repeat up to 500 times (for example, a waiting-room message) until another event moves the call forward.

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak loop="3">Your call is important to us. Please stay on the line.</Speak>
</Response>
```

## Edge cases and tips

* **Escape special XML characters.** Ampersands and angle brackets in the spoken text must be escaped as `&amp;`, `&lt;`, and `&gt;`. Unescaped characters cause an XML parsing error and the call fails.
* **A voice may not exist for every language.** Not every language has both a `WOMAN` and a `MAN` voice (see the table below). If you request an unavailable combination, Vobiz falls back to the available voice for that language.
* **`Speak` vs `Play`.** Use `Speak` for dynamic, per-call text (account balances, names, confirmation read-backs). Use [`Play`](https://www.vobiz.ai/docs/xml/play) for prerecorded audio when you need consistent quality, music, or branding.
* **Pronunciation control.** For numbers, dates, currency, and pauses, use [SSML](https://www.vobiz.ai/docs/xml/speak/ssml.md) to control how text is read aloud.
* **Text length.** Each `Speak` holds up to 3,000 characters of text.
* **Keep prompts short.** Callers lose attention after 15-20 seconds. Split long content into shorter `Speak` elements or break it up with menu prompts.

## Supported voices and languages

| Language | Code | `WOMAN` plays | `MAN` plays |
| - | - | - | - |
| Hindi | `hi-IN` | Aditi (F) | Aditi (F) |
| Arabic | `arb` | Zeina (F) | Zeina (F) |
| Chinese Mandarin | `cmn-CN` | Zhiyu (F) | Zhiyu (F) |
| Danish | `da-DK` | Naja (F) | Mads (M) |
| Dutch | `nl-NL` | Lotte (F) | Ruben (M) |
| English (Australia) | `en-AU` | Nicole (F) | Russell (M) |
| English (Canada) | `en-CA` | Salli (F) | Joey (M) |
| English (India) | `en-IN` | Aditi (F) | Raveena (F) |
| English (UK) | `en-GB` | Amy (F) | Brian (M) |
| English (US) | `en-US` | Salli (F) | Joey (M) |
| English (Wales) | `en-GB-WLS` | Geraint (M) | Geraint (M) |
| French | `fr-FR` | Celine (F) | Mathieu (M) |
| French (Canada) | `fr-CA` | Chantal (F) | Chantal (F) |
| German | `de-DE` | Marlene (F) | Hans (M) |
| Icelandic | `is-IS` | Dora (F) | Karl (M) |
| Italian | `it-IT` | Carla (F) | Giorgio (M) |
| Japanese | `ja-JP` | Mizuki (F) | Takumi (M) |
| Korean | `ko-KR` | Seoyeon (F) | Seoyeon (F) |
| Norwegian | `nb-NO` | Liv (F) | Liv (F) |
| Polish | `pl-PL` | Maja (F) | Jacek (M) |
| Portuguese (Brazil) | `pt-BR` | Vitoria (F) | Ricardo (M) |
| Portuguese (Portugal) | `pt-PT` | Ines (F) | Cristiano (M) |
| Romanian | `ro-RO` | Carmen (F) | Carmen (F) |
| Russian | `ru-RU` | Tatyana (F) | Tatyana (F) |
| Spanish (Mexico) | `es-MX` | Mia (F) | Mia (F) |
| Spanish (Spain) | `es-ES` | Conchita (F) | Enrique (M) |
| Spanish (US) | `es-US` | Penelope (F) | Miguel (M) |
| Swedish | `sv-SE` | Astrid (F) | Astrid (F) |
| Turkish | `tr-TR` | Filiz (F) | Filiz (F) |
| Welsh | `cy-GB` | Gwyneth (F) | Gwyneth (F) |

F and M show the voice's gender.

* **One voice per language.** Where a language has one voice, `WOMAN` and `MAN` both play it. The table shows the voice each value plays.
* **English (Canada).** `en-CA` uses the English (US) voices.
* **Regional codes.** A regional code outside this table, such as `nl-BE`, `de-AT`, `it-CH`, `es-AR`, `en-NZ`, `en-ZA`, or `fr-BE`, uses a voice for its base language. This applies to `da`, `nl`, `en`, `fr`, `de`, `it`, `pl`, `pt`, `ru`, `es`, and `sv`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.