_discard_audio_if_uninterruptible_: bool = True, w...
# ask-ai
c
_discard_audio_if_uninterruptible_: bool = True, what does this variable mean?
t
Thanks for reaching out, Subham. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I’d love to help you understand the _discard_audio_if_uninterruptible_ variable a bit better! This configuration option controls how incoming user audio is treated when the agent is speaking and its speech is marked as non-interruptible. When it’s set to
True
, any audio frames from the user during this uninterruptible speech are gently set aside and not processed further. This helps avoid any confusion or overlap in the conversation once the agent finishes speaking. By default, this variable is set to
True
, which helps keep the conversation flowing smoothly and clearly, especially when timing is important. It works hand-in-hand with the _allow_interruptions_ parameter: if interruptions aren’t allowed and _discard_audio_if_uninterruptible_ is active, all user audio during that time is simply ignored to maintain clarity. This setting is really handy in situations like preemptive generation or real-time voice agent design, where managing audio carefully prevents delays or responses that might feel out of place. I hope this explanation makes it a bit clearer and helps you feel more confident working with this feature! Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/real... | agents/src/voice/agent_session.ts | Agent Session & Client Integration | livekit/livekit_composite | DeepWiki