I need some help debugging an issue I'm facing with my agent.
I'm streaming audio chunks from a tokenizer to a custom TTS class. The problem is that sometimes, when a new chunk arrives, the previous audio gets replayed briefly at the end—almost like an echo effect. It doesn’t happen consistently, but enough to break the flow.
I suspect this might be an issue on the livekit side, possibly related to how I'm handling flushes, synthesized streams, or maybe my no-wait event logic. But I haven't been able to pinpoint it or debug further.