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

# Play Audio

> Play a pre-recorded audio file to the caller

The **Play Audio** node plays an audio file from a URL to the caller.

## Behavior

* Streams audio from the configured URL
* Optionally loops the audio a specified number of times
* Emits `AUDIO.COMPLETE` when playback finishes or `AUDIO.ERROR` on failure

## Configuration

| Parameter     | Type    | Default | Range | Description                                                  |
| ------------- | ------- | ------- | ----- | ------------------------------------------------------------ |
| `audioSource` | enum    | `"url"` | `url` | Audio source type                                            |
| `audioUrl`    | string  | `""`    | —     | URL of the audio file to play                                |
| `loop`        | boolean | `false` | —     | Enable looping playback                                      |
| `loopCount`   | number  | `1`     | 1–10  | Number of times to loop (only applies when `loop` is `true`) |

## Output handles

| Handle       | Description                                                      |
| ------------ | ---------------------------------------------------------------- |
| **Complete** | Audio finished playing — flow continues to the next node         |
| **Error**    | Playback failed (invalid URL, network error, unsupported format) |

## Output variables

| Variable   | Type   | Description                                  |
| ---------- | ------ | -------------------------------------------- |
| `duration` | number | Duration of the played audio in milliseconds |

## Use cases

<AccordionGroup>
  <Accordion title="Hold music">
    Enable `loop` with `loopCount: 5` to play background music while the caller waits in a queue.
  </Accordion>

  <Accordion title="Legal disclaimer">
    Play a pre-recorded compliance message before connecting to an agent. Use the `duration` output variable to set a matching `hangupDelay` on the End Call node.
  </Accordion>

  <Accordion title="Localized greetings">
    Use a Switch node on the caller's language, then route to different Play Audio nodes with region-specific audio URLs.
  </Accordion>
</AccordionGroup>
