wise-white
wise-white3d ago

How can we play an mp3 audio file ( recorded disclosure) before the agent say its greetings.

How can we play an mp3 audio file ( recorded disclosure) before the agent say its greetings. Please send me video tutorials and documentation. Thank you
1 Reply
Sahil
Sahil2d ago
Hi DanToy, To play an MP3 audio file, such as a recorded disclosure, before the agent's greeting, you can utilize the Live Call Control features in Vapi. Here's how you can set it up: 1. Initiate the Call: When you initiate the call using the /call endpoint, you'll receive a controlUrl. 2. Play Audio Clip: Use the controlUrl to send a say command with the URL of your MP3 audio file. Here's a sample curl request:
curl -X POST 'https://your-control-url' \
-H 'content-type: application/json' \
--data-raw '{
"type": "say",
"content": "[URL_OF_YOUR_AUDIO_CLIP]",
"endCallAfterSpoken": false
}'

curl -X POST 'https://your-control-url' \
-H 'content-type: application/json' \
--data-raw '{
"type": "say",
"content": "[URL_OF_YOUR_AUDIO_CLIP]",
"endCallAfterSpoken": false
}'

Replace [URL_OF_YOUR_AUDIO_CLIP] with your actual audio file URL. For further details, you can refer to Vapi's Live Call Control documentation. Please let us know if this works on your end.

Did you find this page helpful?