Skip to main content

Play Music

The play action will play the audio file to the caller, by greeting the caller with specific pre-recorded music or playing the music while the caller is on hold. PIOPIY supports both mp3 and wav file formats.

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

const { StreamAction } = require("piopiy");

const stream = new StreamAction();

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

Parameters type and description

ParameterTypeDescription
music_filestringThe music file or music file URL of the music file to be played.