Dub

Add one or more additional audio tracks into the conversation

1{
2 "verb": "dub",
3 "action": "addTrack",
4 "track": "ambient-noise",
5},
6{
7 "verb": "dub",
8 "action": "playOnTrack",
9 "track": "ambient-noise",
10 "play": "https://example.com/sounds/office-hubbub.mp3"
11}

Verb properties for the dub command:

Parameters

action
stringRequired

One of ‘addTrack’, ‘removeTrack’, ‘silenceTrack’, ‘playOnTrack’, or ‘sayOnTrack’.

gain
string

A string value in the format “-6 dB” specifying decibels to boost or reduce the strength of the audio signal
(note: simple integer values accepted as well). The value supplied must be between ±50 dB.

loop
boolean

If true, loop the mp3.

play
string

An http(s) URL to an mp3 file to play into the track.

say
string

Text to convert to audio and play into the track.

track
stringRequired

Label for the track.

The various options are:

  • addTrack adds an audio track to the conversation; once added, the play or say command may be used to inject audio into the track
  • removeTrack removes an audio track from the conversation
  • silenceTrack silences an audio track but leaves it in place
  • playOnTrack plays audio from an http(s) mp3 url into the audio track
  • sayOnTrack generates text-to-speech into the audio track

Note: all tracks are automatically removed when the call completes, so if using an additional track for the entire conversation there is no need to explicitly remove it when the call ends.

Note: for convenience the addTrack and playOnTrack operations may be combined into a single addTrack verb; e.g.:

1 {
2 "verb": "dub",
3 "action": "addTrack",
4 "track": "ambient-noise",
5 "play": "https://example.com/sounds/office-hubbub.mp3",
6 "loop": true,
7 "gain": "-10 dB"
8 }

See Using dub tracks for more information.