WebSocket media protocol
curl --request GET \
--url https://core.wadial.com/api/v1/sessions/{sessionId}/calls/{callId}/media \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.wadial.com/api/v1/sessions/{sessionId}/calls/{callId}/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://core.wadial.com/api/v1/sessions/{sessionId}/calls/{callId}/media"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)API Reference
WebSocket media protocol
Stream live call audio with 16 kHz Float32LE PCM frames.
GET
/
api
/
v1
/
sessions
/
{sessionId}
/
calls
/
{callId}
/
media
WebSocket media protocol
curl --request GET \
--url https://core.wadial.com/api/v1/sessions/{sessionId}/calls/{callId}/media \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.wadial.com/api/v1/sessions/{sessionId}/calls/{callId}/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://core.wadial.com/api/v1/sessions/{sessionId}/calls/{callId}/media"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)Upgrade this endpoint to a WebSocket with the same bearer token used for REST calls.
Client binary frames are outbound peer audio:
Server binary frames are inbound peer audio with the same format.
Backpressure:
Slow or pause your producer when
Errors:
Raw audio is only carried by this WebSocket. SSE and webhooks carry metadata events only.
| Field | Value |
|---|---|
| Encoding | Float32LE |
| Sample rate | 16000 Hz |
| Channels | 1 mono |
Server text frames
{
"type": "ready",
"media": {
"direction": "bidirectional",
"encoding": "Float32LE",
"sampleRate": 16000,
"channels": 1
}
}
{
"type": "buffer",
"bufferedMs": 240,
"pauseMs": 500,
"resumeMs": 250
}
bufferedMs reaches pauseMs; resume when it drains near resumeMs.
Call state:
{
"type": "call_state",
"call": {
"callId": "call-123",
"state": "active"
}
}
{
"type": "error",
"code": "invalid_pcm_frame",
"message": "Binary frames must be Float32LE PCM with 4-byte alignment"
}
Was this page helpful?