Discussions
Intermittent Streaming Avatar Session Failure: Sometimes streaming.new Takes 7s and No RTC Connection
about 1 month ago by Leroy Guillaume
Hello everyone, I’m encountering an intermittent issue with HeyGen’s Streaming Avatar sessions. Sometimes everything works perfectly:
streaming.new
returns in about 800 ms,streaming.start
responds with a 200 status,- The RTC connection is established, and
- My initial message is successfully sent.
However, at other times, streaming.new
takes around 7 seconds, and after the regions
request, nothing else happens. The avatar never “wakes up,” the RTC connection isn’t opened, and my initial message is never sent. Here’s a summary of the two scenarios:
-
Working scenario:
streaming.new
→ 200 in ~820 msstreaming.start
→ 200 in ~617 ms- A WebSocket (RTC) connection is established
initial_message
→ 200streaming.task
→ 200
-
Failing scenario:
streaming.new
→ 200 but takes ~7.00 sstreaming.start
→ 200 in ~546 ms- After
regions
→ 200, there is no RTC connection and no initial message
I’m using the same code and environment in both cases. I’m not hitting concurrency limits, and I’m using a valid avatar ID with the same token. Could someone please help me understand why the session fails to start in some cases, or how to ensure the avatar consistently “wakes up”? Thank you!