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.
- Curl
- Node.js
- Python
To play an audio file during the call using Curl:
Play action JSON
[
{
action: "play",
file_name: "welcome_11112.mp3",
}
]
Parameters type and description
Parameter | Type | Description |
---|---|---|
*action | string | The PCMO action to control the flow of the call. |
*file_name (or) file_url | string | The file_name will play the audio file from TeleCMI cloud CDN, and the file_url will play the audio file from your own cloud CDN. |
Note
All above parameters are mandatory.
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.
const {PiopiyAction} = require("piopiy");
var action = new PiopiyAction();
const music_file = "https://example.com/your_music_file.wav"
action.playMusic(music_file)
Parameters type and description
Parameter | Type | Description |
---|---|---|
music_file | string | The music file or music file URL of the music file to be played. |
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.
from piopiy import Action
action = Action()
music_file = "https://example.com/your_music_file.wav" # Example music file or music file URL
action.playMusic(music_file)
Parameters type and description
Parameter | Type | Description |
---|---|---|
music_file | string | The music file or music file URL of the music file to be played. |