broad-painter-9222
11/14/2025, 10:51 AMtall-airline-16756
11/14/2025, 10:51 AMtall-airline-16756
11/14/2025, 10:52 AMUserStateChangedEvent and AgentStateChangedEvent come with a created_at timestamp, which tells you exactly when speech or state changes happen.
• Interruption Indicators: The PlaybackFinishedEvent includes an interrupted field and a playback_position timestamp, so you can see precisely when playback was interrupted.
• Speech Handle: The SpeechHandle.interrupted property helps you know if a specific speech was interrupted.
• False Interruptions: The AgentFalseInterruptionEvent provides useful details like resumed and created_at to track false interruptions.
These tools are designed to help you monitor and log interruptions smoothly. If you'd like, I’m here to guide you through implementing any of these—just let me know!
Sources: livekit-agents/livekit/agents/voice/agent_activity.py | Events and error handling | LiveKit docs | agents/src/voice/agent_activity.ts | Turn detection and interruptions | LiveKit Docsbroad-painter-9222
11/14/2025, 10:54 AMtall-airline-16756
11/14/2025, 10:54 AMon_vad_inference_done method to catch VAD events. The speech_duration and silence_duration fields are really useful to figure out the interruption timestamp.
2. Calculate Interruption Timestamp: Just apply this formula: interruption_timestamp = current_time - silence_duration. This will help you pinpoint when the user started speaking.
3. STT Verification (Optional): If you have it set up, double-check that the transcript has a minimum word count before confirming the interruption. This adds an extra layer of accuracy.
4. Event Listeners: Keep an eye on UserStateChangedEvent or AgentStateChangedEvent to know exactly when the assistant starts speaking and when the user interrupts.
If you’d like, I’m here to help you implement this or clarify anything further. Just let me know!
Sources: livekit-agents/livekit/agents/voice/agent_activity.py | examples/src/realtime_turn_detector.ts | Turn detection and interruptions | LiveKit Docs