---
title: Dynamic Audio Message
slug: business-phone-system/dynamic-audio-message
createdAt: 2025-10-10T19:19:10.797Z
---

Many a time you may want to play out a dynamic audio file to the caller based on who's calling when they are calling, or based on their IVR inputs. In order to do that you need to do the following.

1. In the Audio picker, you need to choose the 'Type Text' option
2. Enter your application URL which will, in turn, return a URL of the Audio file.&#x20;
3. The Audio file MUST be in the .wav, .mp3, 8Khz Mono format. The bit depth must be 16 bits.

:::hint{type="info"}
All other formats are **not** supported (eg. 16Kz Mono/Stereo etc)
:::

## Example

In the 'Type Text' option of the audio picker, we have configured a URL

![](https://api.archbee.com/api/optimize/SK2urIgCC2ml99YyqWOSl/7I4dtJtm9wmqvIEmEPD_9-20260729-043112.png?1639081708)

When Exotel makes an HTTP GET to this URL&#x20;

`http://example.com/exotel/dynamicaudio.php`

the HTTP response should&#x20;

- Contain this header: `content-type: text/plain`
- HTTP body must have the wav file URL one in each line

`http://example.com/first-audio.wav`

`http://example.com/second-audio.wav`

Exotel will then download and play the audio files one after the other to the person on the call.&#x20;

## Caching of the audio files

Exotel caches the audio files that it downloads and plays - so that the next time you send the same file, we don't need to download and it will be faster.

Exotel caches the file based on the **name of the URL.&#x20;**&#x53;o if case you are changing first-audio.wav, you will need to send in another name the next time (*Ex: http\://example.com/first-audio-new\.wav*)

## Conversion of audio files from any format to the required format

If you're on Linux, you can use ffmpeg to convert any audio file to the file format accepted by Exotel using the below command:

`ffmpeg -loglevel quiet -y -i /path/to/audiofile -ar 8000 -ac 1 /path/to/target.wav`

Explain Shell has a good explanation of what these options to ffmpeg mean: `http://explainshell.com/explain?cmd=ffmpeg+-loglevel+quiet+-y+-i+%2Fpath%2Fto%2Faudiofile+-ar+8000+-ac+1+%2Fpath%2Fto%2Ftarget.wav`

## Watch a short video

:::Iframe{iframeHeight="0" code="<div style=&#x22;position: relative;padding-bottom: 56.25%;height: 0;border-radius: 0;box-shadow: 0 15px 40px rgba(63,58,79,.3);overflow: hidden;min-width:320px&#x22;><iframe src=&#x22;https://learn.exotel.com/share/833dc478-8ff4-4dc6-9759-98df0ac5facb/embed&#x22; frameborder=&#x22;0&#x22; webkitallowfullscreen mozallowfullscreen allowfullscreen allow=&#x22;autoplay; fullscreen&#x22; style=&#x22;position: absolute; top: 0; left: 0; width: 100%; height: 100%;&#x22;></iframe></div>"}

:::
