Playlist
A Playlist object allows you to specify a series of media which should be played in sequence. You can then pass the playlist to the methods that support it, for example Call.play.
Example
In this example, we create a playlist for playing the following items sequentially:
- A TTS message
- 1 second of silence
- An mp3 file
Constructors
constructor
• new Playlist(params?)
Instantiates an empty Playlist. Use the add method to add media to this Playlist.
Parameters
Object containing the parameters of the constructor.
Default volume to apply to the media in the playlist, between -40dB and +40dB.
Example
Properties
The list of media items that have been added to this Playlist.
The default volume for the audio in the playlist, between -40dB and +40dB.
Methods
add
▸ add(params): Playlist
Adds the speecified media in series to the Playlist.
Parameters
Returns
Example
A playlist to play some audio, then a short silence, and finally a ringtone.
Audio
▸ Static Audio(params): Object
An audio media.
Parameters
Object containing the parameters of the method.
URL of media to play.
Returns
Object
Example
Ringtone
▸ Static Ringtone(params): Object
A ringtone media.
Parameters
Object containing the parameters of the method.
Name of the ringtone to play. See RingtoneName.
How long to play ringtone, in seconds.
Returns
Object
Example
Silence
▸ Static Silence(params): Object
A silence interval.
Parameters
Object containing the parameters of the method.
How long to play silence, in seconds.
Returns
Object
Example
TTS
▸ Static TTS(params): Object
A TTS media.
Parameters
Object containing the parameters of the method.
Text to play. SSML may be entered as a string wrapped in <speak> tags. See our supported voices and languages documentation for usage and supported tags.
Language of the text in ISO 639-1 (language name) + ISO 3166 (country code). Supported languages can be found here.
Gender of the voice.
Voice to use (takes precedence over gender). Supported voices can be found here.
Returns
Object