Discussions

Ask a Question
Back to all

websocket "ws_url" closing immediately

I am using LiveAvatar in CUSTOM mode for a conversational demo app. Initially, I am connecting to "ws_url" and it is successful. My first attempt was to speak on mic then send chunks of audio (response from a knowledge base) to LiveAvatar's websocket using the agent.speak and then followed by agent.speak_end after all chunks are sent.

The LiveAvatar successfully lipsynced the audio. However, after that, I tried to speak again, the audio chunks failed to be sent because of "[ERROR] WebSocket closed! Code=1006, Reason=". Note that this happened immediately after the avatar stopped speaking from the first conversation. There's also no long-time gap between my first and succeeding attempts.

Why is the websocket closing immediately?