Huzaifa Tahir
10/21/2025, 11:02 AMVapi Support Bot
10/21/2025, 11:04 AMwebsocketCallUrl and stream audio as it arrives. Here’s a Node.js example:
js
const WebSocket = require('ws');
let pcmBuffer = Buffer.alloc(0);
const ws = new WebSocket('wss://api.vapi.ai/YOUR_CALL_ID/transport');
ws.on('message', (data, isBinary) => {
if (isBinary) {
pcmBuffer = Buffer.concat([pcmBuffer, data]);
// Upload pcmBuffer to S3 here or in chunks
}
});
This lets you process and store audio in real time—no need to wait for the call to end. Be sure to initiate the call with the WebSocket transport to get the correct URL and streaming behavior.
For more details, see the [Vapi WebSocket transport documentation](https://docs.vapi.ai/calls/websocket-transport).
Source:
- [WebSocket Transport](https://docs.vapi.ai/calls/websocket-transport)Chiranjeet Mishra
10/21/2025, 7:09 PM