Play
The Play verb is used to play an audio file to the remote party.

Play Attributes

Name
Allowed Values
Default Value
Loop
integer > 1
1
loop. The 'loop' attribute specifies how many times you’d like the audio file to be repeated. Specifying '0' will cause the the <Play> verb to loop until the call is hung up.

Supported Audio Formats

MIME type
Description
audio/wav
wav format audio
audio/mp3
mp3 format audio
audio/wave
wav format audio
audio/x-wav
wav format audio

Media Server Audio File Format

Technical Specification and Capacity

The calls.teleapi Media Server is capable of:

Media and Codecs:
  • G711 (a-Law, u-Law);
  • GSM;
  • Linear PCM(L16);
  • G729;
  • DTMF(RFC 2833, INBAND)
Media Files:
  • Wav (Sample rate 8000Hz, bit rate of 16, Mono);
  • mp3 (Any sample rate)
  • GSM

How to Convert a Wav File to the Correct Bitrate

You can use a software call ffmpeg as follows:
1
ffmpeg -i source_file.wav -acodec pcm_s16le -ac 1 -ar 8000 result_file.wav
Copied!

Nesting

The verb can not have any other verbs or nouns nested. Only a URL.

Examples

Example of how to use the verb:
1
<Response>
2
<Play>http://foobar.com/demo.wav</Play>
3
</Response>
4
<Response>
5
<Play>http://foobar.com/demo.mp4</Play>
6
</Response>
Copied!
Last modified 1yr ago