What is rotatesegment?
# ask-ai
w
What is rotatesegment?
t
Thanks for reaching out, Arthur. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The
rotate_segment()
method is a handy part of the
TranscriptSynchronizer
class in LiveKit's Agents framework. Think of it as a way to refresh or "rotate" the internal segment synchronizer behind the scenes. Here’s what it does: • It restarts the synchronizer by creating a fresh
_SegmentSynchronizerImpl
instance. • Includes safety checks to make sure it doesn’t try to rotate more than once at the same time. • Runs asynchronously so it won’t slow down the main process. You don’t have to worry about calling it yourself—it automatically kicks in when the synchronizer’s enabled state changes, like when both audio and text are connected. This is all part of LiveKit’s transcription system that helps convert speech to text in real-time and keeps everything nicely synced for voice agents. Sources: livekit-agents/livekit/agents/voice/transcription/synchronizer.py