Dub

Dub4

/ dʌb /
PHONETIC RESPELLING

verb (used with object), dubbed, dub·bing.

  1. To furnish (a film or tape) with a new soundtrack, especially one recorded in a different language.
  2. To add (music, speech, etc.) to a film or tape recording (often followed by in).

verb (used without object), dubbed, dub·bing.

  1. To copy program material from one tape recording onto another.

The dub verb adds one or more additional audio tracks into the conversation (currently, a maximum of two additional audio tracks may be added). Audio can then be inserted into these tracks, and it will be blended with the play or say content being sent to the caller/called party. The source of the audio content can be either text-to-speech or MP3 audio accessible via HTTP(s).

Additionally, the volume (gain) of the inserted audio may be adjusted up or down. As well, the config.boostAudioSignal allows the volume in the main conversational channel to be adjusted as well.

{
  "verb": "dub",
  "action": "addTrack",
  "track": "ambient-noise"
},
{
  "verb": "dub",
  "action": "playOnTrack",
  "track": "ambient-noise",
  "play": "https://example.com/sounds/office-hubbub.mp3"
}

Verb properties for the dub command:

Option Description Required
action One of 'addTrack', 'removeTrack', 'silenceTrack', 'playOnTrack', or 'sayOnTrack'. Yes
track Label for the track. Yes
play An HTTP(s) URL to an MP3 file to play into the track. No
say Text to convert to audio and play into the track. No
loop Boolean; if true, loop the MP3. No
gain 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. No

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’s 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; for example:

{
  "verb": "dub",
  "action": "addTrack",
  "track": "ambient-noise",
  "play": "https://example.com/sounds/office-hubbub.mp3",
  "loop": true,
  "gain": "-10 dB"
}

See Using dub tracks for more information.

Ready To Get Started?