Latest Legacy

Play audio event

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.

Attributes

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.
Allowed values: audio/x-l16, audio/x-mulaw

sampleRate

Sample rate of the audio transmitted.
Allowed values:
audio/x-l16: 8000, 16000
audio/x-mulaw: 8000

payload

Base64-encoded string of raw audio

Response

Request

{
  "event": "playAudio",
  "media": {
    "contentType": "audio/x-l16",
    "sampleRate": 8000,
    "payload": "base64 encoded raw audio.."
  }
}