You can utilize the playAudio event to transmit audio through the WebSocket. When the bi-directional attribute is set to true, Plivo can deliver the audio transmitted from your application to the party on the call.
event |
Indicates the event type. playAudio is the value required to transmit audio over the WebSocket. |
media |
An object containing media metadata and payload |
contentType |
The audio codec format. |
sampleRate |
Sample rate of the audio transmitted. |
payload |
Base64-encoded string of raw audio |
{
"event": "playAudio",
"media": {
"contentType": "audio/x-l16",
"sampleRate": 8000,
"payload": "base64 encoded raw audio.."
}
}