> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Play

The `<Play>` verb plays an MP3 or WAV audio file, which Telnyx fetches back to the caller from the URL you configure.
Alternatively, specify `mediaStorage="true"` to fetch a file you previously uploaded to Telnyx using media storage APIs. When `mediaStorage="true"` is used the verb expects a `media_name` instead of a URL.
You can also use the `digits` attribute to play DTMF tones instead of an audio file.
The `ringTone` attribute generates a country-specific ringback tone instead of fetching an audio file; it cannot be combined with an audio body and is not supported inside `<Conference>`.
By default, a playback failure (e.g. the audio URL returns 404) aborts the TeXML script. Set `continueOnError="true"` to log the failure and proceed with the next verb instead.
Set `failoverUrl` to retry once with a backup audio source before the failure path is taken; `continueOnError` still applies if the failover also fails.
`<Play>` can be used independently as a verb or nested within `<Gather>` as a noun to play an audio file while waiting for DTMF tones.

## Attributes

<table>
  <thead>
    <tr>
      <th>ATTRIBUTE</th>
      <th>DESCRIPTION</th>
      <th>OPTIONS</th>
      <th>DEFAULT</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>loop</code></td>
      <td> Times to repeat the audio. When used with `ringTone`, forwarded to FreeSWITCH as the `tone_stream` `loops` parameter; `loop="0"` plays the tone indefinitely until interrupted by a subsequent verb or hangup. </td>

      <td />

      <td><code>1</code></td>
    </tr>

    <tr>
      <td><code>mediaStorage</code></td>
      <td> When true fetches the file from Telnyx media storage using the provided media name. </td>
      <td><code>true</code>, <code>false</code></td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>digits</code></td>
      <td> DTMF tones to play. The value can include digits 0-9, \*, #, and w (for a 0.5 second pause). When specified, the verb plays DTMF tones instead of an audio file. </td>

      <td />

      <td>-</td>
    </tr>

    <tr>
      <td><code>failoverUrl</code></td>
      <td> Backup audio source played when the primary URL fails. The `mediaStorage` flag also applies to this URL. Only one retry attempt is made. </td>

      <td />

      <td>-</td>
    </tr>

    <tr>
      <td><code>continueOnError</code></td>
      <td> When true, a playback failure does not abort the script. Telnyx still logs the error and continues with the next verb. </td>
      <td><code>true</code>, <code>false</code></td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>ringTone</code></td>
      <td> Plays a country-specific ringback tone instead of an audio file. Cannot be combined with an audio body. Not supported inside `<Conference>`. </td>
      <td><code>at</code>, <code>au</code>, <code>bg</code>, <code>br</code>, <code>be</code>, <code>ch</code>, <code>cl</code>, <code>cn</code>, <code>cz</code>, <code>de</code>, <code>dk</code>, <code>ee</code>, <code>es</code>, <code>fi</code>, <code>fr</code>, <code>gr</code>, <code>hu</code>, <code>il</code>, <code>in</code>, <code>it</code>, <code>lt</code>, <code>jp</code>, <code>mx</code>, <code>my</code>, <code>nl</code>, <code>no</code>, <code>nz</code>, <code>ph</code>, <code>pl</code>, <code>pt</code>, <code>ru</code>, <code>se</code>, <code>sg</code>, <code>th</code>, <code>tw</code>, <code>ve</code>, <code>za</code>, <code>us</code>, <code>us-old</code>, <code>uk</code></td>
      <td>-</td>
    </tr>
  </tbody>
</table>

## Examples

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play>https://example.com/welcome.mp3</Play>
</Response>
```

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play ringTone="us" loop="3"/>
</Response>
```

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play continueOnError="true">https://example.com/might-404.mp3</Play>
    <Say>Sorry, we could not play the message.</Say>
</Response>
```

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play failoverUrl="https://cdn-backup.example.com/welcome.mp3">https://cdn.example.com/welcome.mp3</Play>
</Response>
```
