Discussions

Ask a Question
Back to All

Streaming SDK: startVoiceChat Hang / WebSocket Connection Failure

I'm encountering an issue with streamingAvatar.startVoiceChat() using the @heygen/streaming-avatar@^2.0.12 SDK (or latest 2.x).

createStartAvatar completes successfully, and the STREAM_READY event fires for the video stream. However, the subsequent await streamingAvatar.startVoiceChat() call either hangs indefinitely (observed in Chrome) or fails with an explicit WebSocket connection error to wss://api.heygen.com/v1/ws/streaming.chat (observed in Brave and sometimes Chrome developer logs). The microphone does not activate.

Notably:

This exact setup (same machine, network, localhost) used to work correctly.
A direct test using navigator.mediaDevices.getUserMedia({ audio: true }) on the same page succeeds, confirming basic browser mic access is okay.
Local firewall/network issues have been investigated and are unlikely the cause.
Could you please advise if this is a known issue, potentially a backend problem with the WebSocket session initialization, or if there are further diagnostics I can perform? I can provide specific session IDs from the logs if helpful.