cool-queen-46059
04/23/2026, 1:19 PMtall-airline-16756
04/23/2026, 1:19 PMtall-airline-16756
04/23/2026, 1:19 PMcool-queen-46059
04/23/2026, 1:22 PMtall-airline-16756
04/23/2026, 1:23 PMagent_session_config you shared and this is what’s likely happening and what to try next.
What’s likely causing the missed speech
• discard_audio_if_uninterruptible = true — when the agent is speaking or a tool call is running and cannot be interrupted, incoming user audio is dropped instead of buffered. This will cause missed words or whole utterances (especially during long TTS/tool responses).
• max_endpointing_delay = 1.5s — shorter than the typical default (6s). On telephony or speakerphone calls with longer/hesitant pauses, a short max endpointing delay can cause premature end-of-turn detection and truncated user speech.
• preemptive_generation = true and interruption settings — preemptive LLM generation based on interim transcripts can lead to the agent continuing to generate/speak while newer user audio arrives; combined with discarding behavior, that audio can be lost.
• min_interruption_duration = 0.3s — low enough to treat brief sounds as interruptions; in combination with the above settings it can create false interruption behavior or missed capture—but it’s less likely to be the primary cause.
Recommended quick changes to test
1. Set discard_audio_if_uninterruptible → false to ensure user speech is buffered while the agent/tool is speaking.
2. Increase max_endpointing_delay → 4.0–6.0s to allow for natural pauses on phone and speakerphone calls.
3. Keep preemptive_generation if you need lower latency, but monitor for cases where final transcripts differ from interim ones; consider temporarily disabling it to test if capture improves.
4. If you see missed audio specifically after tool calls, ensure the agent allows interruptions immediately after the tool completes (or call `session.interrupt()`/resume listening flow) so new audio is accepted.
5. Monitor events: track user_input_transcribed, user_state_changed, and any post-tool-call events to see whether speech is detected but later discarded.
If you want, I can:
• Provide the exact config snippets to apply those changes.
• Explain how to instrument user_input_transcribed and user_state_changed logging to confirm whether speech is being detected or dropped.
Which would you prefer?
Sources: Turns overview | LiveKit Documentation | Agent session | LiveKit Documentation | Silero VAD plugin | LiveKit Documentation, with interactive elementscool-queen-46059
04/23/2026, 1:26 PMtall-airline-16756
04/23/2026, 1:27 PMuser_input_transcribed and user_state_changed to confirm whether audio is detected then discarded or never detected.
Quick suggested config snippet to try
{
"discard_audio_if_uninterruptible": false,
"max_endpointing_delay": 6,
"min_endpointing_delay": 0.5,
"min_interruption_duration": 0.1,
"preemptive_generation": false
}
If you want, I can:
• Provide a smaller test plan to A/B the changes (which calls to make, what metrics/events to watch).
• Show the exact logging/events to check to confirm whether speech is detected and then discarded or never detected.
Which would you like to do next?
Sources: Using a transformer to improve end of turn detection | LiveKit | Using a transformer to improve end of turn detection | LiveKit | Turns overview | LiveKit Documentation | Agent speech and audio | LiveKit Documentation | Gemini Live API plugin | LiveKit Documentation, with interactive elementscool-queen-46059
04/23/2026, 1:38 PMtall-airline-16756
04/23/2026, 1:39 PMcool-queen-46059
04/23/2026, 1:40 PMtall-airline-16756
04/23/2026, 1:40 PMdiscard_audio_if_uninterruptible = true actually does
• It only drops incoming user audio when the agent (or a running tool/TTS) is in an uninterruptible state.
• If the agent is interruptible, incoming audio is accepted and processed even while it’s speaking or generating.
Why you might still see “interruptions”
• The agent can be speaking yet still be marked interruptible (so user speech interrupts and is captured). That explains why you see interrupts sometimes even with discard_audio_if_uninterruptible=true.
• Conversely, if the agent briefly flips to uninterruptible during parts of its response (e.g., certain tool calls, scheduled speech, or state transitions), audio arriving in that window will be dropped.
What to check next
• Confirm the agent’s interruption policy/state during those question→reply interactions (is the agent actually uninterruptible when speaking?).
• Look at events/logs around the moment of missed audio: check user_input_transcribed, agent_speaking_started/stopped, tool-call start/finish, and any session.interrupt() or interruption-mode changes.
• For a quick test, set discard_audio_if_uninterruptible = false and reproduce the case; if misses stop, the flag (or brief uninterruptible windows) were the cause.
If you want, I can provide the exact events to log and a short A/B test plan to confirm whether brief uninterruptible windows are dropping audio. Which would you like?
, with interactive elementscool-queen-46059
04/23/2026, 1:41 PMtall-airline-16756
04/23/2026, 1:42 PMuser_input_transcribed events, agent_speaking_started/stopped, and whether discard_audio_if_uninterruptible was true at that moment.
With one concrete example (timestamped logs or a short transcript) I’ll pinpoint which setting is responsible and give exact config changes and test steps.
, with interactive elementscool-queen-46059
04/23/2026, 1:44 PMtall-airline-16756
04/23/2026, 1:44 PMmin_endpointing_delay = 0.4s, max_endpointing_delay = 1.5s) and `silence_duration_ms = 500`: the system may classify a short “yes” as part of silence or as an interruption that doesn’t meet thresholds.
◦ `min_interruption_duration = 0.3s`: if the “yes” is shorter than this threshold it may not register as a valid interruption.
Could code cause this?
• Possible but less likely. Code bugs that:
◦ accidentally mute/unsubscribe the PSTN audio stream,
◦ incorrectly forward or buffer audio chunks,
◦ or drop interim transcripts after tool/LLM state changes
could cause misses. But the pattern you describe (short loud words missed, sometimes with yelling) strongly points to VAD/endpointing and discard behavior first.
Concrete changes to try (quick A/B)
• Set discard_audio_if_uninterruptible: false (preserve audio arriving during agent speech).
• Increase endpointing tolerances:
◦ max_endpointing_delay → 4–6s
◦ min_endpointing_delay → 0.5s
• Make interruptions easier to register:
◦ min_interruption_duration → 0.08–0.1s
◦ Keep silence_duration_ms at 500ms or increase slightly if false positives occur.
• Temporarily disable preemptive_generation to rule out generation/state races.
Suggested test plan
1. Apply the changes above in a staging agent.
2. Run 20 PSTN calls with short replies (single words like “yes”, “no”) across handset and speakerphone.
3. Log these events per call: timestamped agent_speaking_started/stopped, user_input_transcribed (with interim/final), and user_state_changed. Note any cases where audio was received but not transcribed vs. never received.
4. Compare hit-rate vs current prod config.
If you want, I can:
• Provide the exact config JSON to swap in for the test, and
• Give the minimal set of event fields to log (names + timestamps) to prove whether audio was dropped vs not detected.
Which would you like?
, with interactive elementscool-queen-46059
04/23/2026, 1:53 PMtall-airline-16756
04/23/2026, 1:53 PMgemini-live-2.5-flash-native-audio.
Key points:
• The Gemini realtime model runs its own VAD when automatic_activity_detection is enabled, so it will detect start/end of speech using the model-level sensitivities (start_of_speech_sensitivity, end_of_speech_sensitivity, silence_duration_ms).
• LiveKit-side settings (endpointing delays, discard_audio_if_uninterruptible, min_interruption_duration, preemptive_generation, silence detection config) still control buffering, interruption behavior, and when turns are finalized. That means audio can be dropped or turned-ending can happen prematurely even if the model’s VAD detected speech.
• In practice: the realtime model detects speech, but LiveKit’s discard/endpointing/interruption policy determines whether that detected audio is buffered, transcribed, or discarded.
What to do next:
• For realtime use (PSTN) try the changes we discussed: set discard_audio_if_uninterruptible=false, increase max_endpointing_delay to 4–6s, set min_endpointing_delay ≥0.5s, reduce min_interruption_duration to ~0.08–0.1s, and consider disabling preemptive_generation for an A/B test.
• Instrument logs for user_input_transcribed, agent_speaking_started/stopped, and model VAD events to see if the model detected speech but LiveKit discarded it.
If you want, I’ll give the exact config JSON for the realtime agent and the minimal event fields to log for validation. Which would you prefer?
, with interactive elementscool-queen-46059
04/23/2026, 1:57 PMtall-airline-16756
04/23/2026, 1:58 PM