hey do you have any idea of why and how I could ge...
# ask-ai
c
hey do you have any idea of why and how I could get this error within a multi voice agent system?
WARNING livekit.agents - _SegmentSynchronizerImpl text marked as ended in capture text, rotating segment
t
Thanks for reaching out, Clovis. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The warning
livekit.agents - _SegmentSynchronizerImpl text marked as ended in capture text, rotating segment
indicates a timing issue in the text-audio synchronization system. This happens when new text data arrives after the current text segment has already been marked as completed. Common causes include: • Improper segment lifecycle management—segments are marked as ended, but new data still arrives • Timing issues with playback events—`on_playback_finished` may not be called after each flush as expected • Reusing a single stream for multiple segments, which is deprecated—each segment should use a new stream instance Resolution strategies: • The system automatically recovers by rotating to a new segment when this warning occurs • Ensure each segment uses a separate stream instance • Coordinate
flush()
operations with playback completion events to avoid premature segment endings In multi-voice agent systems, this warning often means that segment boundaries are not being respected across different voice sources, or that multiple agents are not properly coordinated. While the system handles this by rotating segments, frequent warnings suggest underlying timing or coordination issues that should be addressed through proper stream and segment management. Sources: livekit-agents/livekit/agents/voice/audio_recognition.py
c
if I use this kind of handoff system when passing from one agent to the other could it be the cause? shared_stt, shared_llm, shared_tts = self.session_collector.get_shared_providers() qualification_agent = QualificationAgent( self.agent_config, room_name=self.room_name, google_plugin_available=self.google_plugin_available, chat_ctx=self.chat_ctx, session_collector=self.session_collector, shared_stt=shared_stt, shared_llm=shared_llm, shared_tts=shared_tts, should_greet=self.is_initial_agent ) return qualification_agent
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
c
is it bad practice to use this kind of init in livekit to use the same tts between agents in the
super().__init__(shared_tts=shared_tts)