Rate this page:

Media player

VoxEngine provides the Player module which allows you to play media files and text-to-speech blocks.

To use Player during an incoming call, first answer a call. You can use the startEarlyMedia method to broadcast speech before the call is answered to create a greeting or a voicemail prompt.

  • Use the createURLPlayer method to play media files. It accepts two arguments: the first is the media file URL string, the second argument is URLPlayerOptions. Follow this link to learn about player options.

After you created a TTS or an URL player, you need to broadcast it to an active call via the sendMediaTo method.

Refer to the code example below to understand how the Player module works:

Player usage sample

Player usage sample

Media player number limit

Please note, that the maximum number of media players per JS session (one scenario) is 10.

See Available Roles