VoxEngine provides the Player module which allows you to play media files and text-to-speech blocks.
Use the createTTSPlayer() function to create a text-to-speech player. It accepts the same arguments as the speech synthesis say() method. Refer to the speech synthesis article to learn about this method usage.
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:
Please note, that the maximum number of media players per JS session (one scenario) is 10.