Key Capabilities
- Bidirectional streaming: Send and receive audio in real-time
- Multiple audio tracks: Stream inbound, outbound, or both tracks
- Flexible codecs: Support for multiple audio formats and sample rates
- Event streaming: Send playback, checkpoint, and control events via WebSocket
Audio directions
A bidirectional stream uses one WebSocket connection, but it describes incoming and outgoing audio separately:media events using start.mediaFormat. Encode each outbound playAudio payload using the format declared in that event.
Attributes
Parameters sent to statusCallbackUrl
This information is sent to thestatusCallbackUrl when an event is triggered.
Status callback events
When you configure astatusCallbackUrl, Vobiz sends HTTP POST/GET requests to that URL when specific stream lifecycle events occur. These are separate from WebSocket events and are useful for logging, monitoring, and triggering business logic.
HTTP Callbacks vs WebSocket EventsHTTP status callbacks (sent to
statusCallbackUrl):- StartStream, PlayedStream, StopStream events
- Sent via HTTP POST/GET to your web server
- For logging, monitoring, and triggering workflows
- Vobiz sends
start,media,playedStream, andclearedAudio - Your application sends
playAudio,checkpoint,clearAudio, andstop - Sent through the WebSocket connection in real time
- For audio streaming and real-time interaction
StartStream - stream started
Fired when the WebSocket connection is successfully established and audio streaming begins.Example StartStream Callback
PlayedStream - checkpoint reached
Fired when audio queued before a checkpoint event has been successfully played to the caller. TheName parameter contains the checkpoint name you specified.
Example PlayedStream Callback
StopStream - stream ended
Fired when the audio streaming session ends. This can happen due to:- Stream timeout (streamTimeout reached)
- Call ended by either party
- WebSocket connection closed
- Network error or disconnection
Example StopStream Callback
Common parameters in all events
Example: handling status callbacks
Node.js Express Handler
Examples
Basic audio stream
Simple one-way audio stream
Bidirectional audio stream
Two-way audio streaming with callbacks
playAudio event.
Stream both tracks with timeout
Stream inbound and outbound audio with 1-hour timeout
Next steps
- Audio formats: 8, 16, and 24 kHz - Choose the correct format for inbound streaming and outbound playback.
- Initiate a Stream - Learn how to establish a WebSocket connection and start streaming audio from active calls.
- Stream Events Overview - Understand how to send events like playAudio, clearAudio, and checkpoint via WebSocket.
- Checkpoint Event - Send checkpoint events to confirm audio playback completion and manage event queues.
- Play Audio Event - Transmit audio through WebSocket for bidirectional audio streaming use cases.