Skip to main content

Play Music

To play an audio file or URL during a call using the PIOPIY PCMO platform, you can use the playMusic method of the PiopiyAction class. The playMusic method takes an audio file or a URL and plays it during an active call.

 playMusic(audioFileOrUrl)
parameterTypeDescription
audioFileOrUrlstringThe URL or path to the audio file that should be played during the call

Example Implementation

  • The following example demonstrates how to play a specific audio file or URL during a call by using the playMusic method:
const { PiopiyAction } = require("piopiy");

const action = new PiopiyAction();

action.playMusic("https://example.com/your_music_file.wav");