Play

Play

The play command streams recorded audio to a call.

{
  "verb": "play",
  "url": "https://example.com/example.mp3",
  "timeoutSecs": 10,
  "seekOffset": 8000,
  "actionHook": "/play/action"
}

You can use the following attributes with the play command:

Option Description Required
url A single URL or an array of URLs (will play in sequence) to a WAV or MP3 file. Yes
loop Number of times to play the URL(s). No (default: 1)
earlyMedia If true and the call has not yet been answered, play the audio without answering the call. Defaults to false. No
timeoutSecs The number of seconds to play the URL. No
seekOffset How many samples to seek into the URL. No
actionHook Webhook that is called when the play verb completes. No

ActionHook Properties

The actionHook that is invoked when the play command completes will include the following properties:

Property Name Description
playback_seconds The number of seconds played.
playback_milliseconds The number of milliseconds played.
playback_last_offset_pos The last offset position in samples.

Ready To Get Started?