Rate this page:

Media player module

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

Before you use VoxEngine Player, first import it to the scenario via the require method:

require(Modules.Player)

To use Player during an inbound 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