fix(livekit): clear AudioSource buffer on interruption

When an InterruptionFrame arrives, the Python-side audio task is
cancelled but frames already submitted to rtc.AudioSource continue
playing from its internal buffer. This causes the bot to keep speaking
for several seconds after being interrupted.

Fix by overriding process_frame in LiveKitOutputTransport to call
audio_source.clear_queue() on InterruptionFrame, immediately flushing
the buffered audio.
This commit is contained in:
ajmeraharsh
2026-03-26 09:47:00 +05:30
parent f311a0b6e4
commit 62484a4fc3
2 changed files with 18 additions and 0 deletions

1
changelog/4151.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed `LiveKitOutputTransport` not clearing the `rtc.AudioSource` internal buffer on interruption, causing the bot to continue speaking for several seconds after being interrupted.