The Audio Stream Object
The Audio Stream object lets you receive the raw audio of a live phone call over a configured WebSocket in near real time.
An Audio Stream object is created when you initiate audio streaming on an active call. The stream connects to your WebSocket URL and transmits raw audio data in real-time. You can configure various parameters like audio track direction, codec, sample rate, and bidirectional capabilities.
Note: Each stream has a unique stream_idthat can be used to retrieve stream details or stop the stream.
Attributes
Audio Stream Object Attributes
| Name | Type | Description |
|---|---|---|
stream_id | string (UUID) | Unique identifier for the audio stream. |
api_id | string (UUID) | Unique identifier for the API request that initiated the stream. |
call_uuid | string (UUID) | Unique identifier of the call associated with this stream. |
account_id | string | Account ID that owns this stream. |
service_url | string (WebSocket URL) | WebSocket URL (wss:// or ws://) to which the audio stream is sent. Example: wss://yourapp.example.com/audiostream |
bidirectional | boolean | Indicates if the WebSocket supports bidirectional audio streaming (read and write). If true, Vobiz accepts incoming audio data. |
audio_track | string | The audio track being streamed. Values: "inbound" (audio received by Vobiz), "outbound" (audio sent by Vobiz), "both" (both directions). Default: "inbound". |
stream_timeout | integer | Maximum duration (in seconds) for audio streaming. Streaming stops after this duration without affecting the rest of the call. Default: 86400 (24 hours). |
status_url | string (URL) | URL to notify when stream events occur (connected, stopped, timeout, failed). |
status_method | string | HTTP method to use for status callbacks. Values: GET, POST. Default: POST. |
content_type | string | Audio codec and sample rate. Values: "audio/x-l16;rate=8000", "audio/x-l16;rate=16000", "audio/x-mulaw;rate=8000". Default: "audio/x-l16;rate=8000". |
extra_headers | string | Key-value pairs sent to the WebSocket service. Format: "key1=value1,key2=value2". Max size: 512 bytes. |
start_time | string (timestamp) | Timestamp when the audio stream started. Format: YYYY-MM-DD HH:mm:ss+TZ |
end_time | string (timestamp) | Timestamp when the audio stream ended. Format: YYYY-MM-DD HH:mm:ss+TZ |
bill_duration | integer | Actual duration of the stream in seconds. |
rounded_bill_duration | integer | Rounded billing duration in seconds based on billing increment. |
billed_amount | string (decimal) | Total amount billed for this stream. |
created_at | string (ISO 8601 timestamp) | Timestamp when the stream object was created. |
resource_uri | string (URI) | API resource URI for this stream object. |
Example Audio Stream Object
JSON
{
"api_id": "aabbccdd-1234-5678-90ab-cdef12345678",
"audio_track": "both",
"bidirectional": false,
"bill_duration": 27,
"billed_amount": "0.00300",
"call_uuid": "call-uuid-xxxx-yyyy-zzzz-abcd",
"created_at": "2025-11-14 13:23:44.136962+00:00",
"end_time": "2025-11-14 18:53:43+05:30",
"account_id": "MA_AABBCC",
"resource_uri": "/v1/Account/MA_AABBCC/Call/call-uuid-xxxx-yyyy-zzzz-abcd/Stream/stream-id-aabbcc-ddeeff/",
"rounded_bill_duration": 60,
"service_url": "wss://yourapp.example.com/audiostream",
"start_time": "2025-11-14 18:53:16+05:30",
"stream_id": "stream-id-aabbcc-ddeeff"
}Important Notes
- When
bidirectionalis true,audio_trackshould not be "outbound" or "both" - The
stream_idis required for retrieve and stop operations - Billing is calculated based on stream duration and pricing tier