SlaviSavanovic
10/12/2024, 8:55 PMVapi
10/12/2024, 8:57 PMonerror
event handler. Make sure to log the error details to understand what might be going wrong.
5. **WebSocket Support**: Ensure that the environment where your code is running supports WebSockets.
6. **Reconnection Logic**: Implement reconnection logic in case the WebSocket connection drops unexpectedly.
If you've checked all these and are still facing issues, it might be helpful to provide more details about the errors you're encountering. If the problem persists, please ask support for more info on this.Vapi
10/12/2024, 8:57 PMVapi
10/12/2024, 8:59 PMSlaviSavanovic
10/12/2024, 9:01 PMSlaviSavanovic
10/12/2024, 9:01 PMSlaviSavanovic
10/13/2024, 5:09 PMShubham Bajaj
10/15/2024, 4:58 PMShubham Bajaj
10/15/2024, 4:59 PMSlaviSavanovic
10/17/2024, 8:21 PMSlaviSavanovic
10/17/2024, 8:23 PMSlaviSavanovic
10/17/2024, 8:26 PMReceived PCM data, buffer size: ${pcmBuffer.length}
);
} else {
console.log('Received message:', JSON.parse(data.toString()));
}
});
ws.on('close', () => {
if (pcmBuffer.length > 0) {
fs.writeFileSync('audio.pcm', pcmBuffer);
console.log('Audio data saved to audio.pcm');
}
});
ws.on('error', (error) => console.error('WebSocket error:', error));SlaviSavanovic
10/17/2024, 8:36 PM