bumpy-student-61140
03/10/2026, 8:47 AMtall-airline-16756
03/10/2026, 8:47 AMtall-airline-16756
03/10/2026, 8:48 AMon_user_turn_completed lifecycle hook to trigger an immediate short utterance such as session.say("Okay, let me check that for you.", allow_interruptions=False). This runs as soon as the user turn ends and gives the user immediate feedback while longer processing (RAG/tool calls/LLM) continues.
• Background / non-verbal feedback during processing:
◦ Use the BackgroundAudioPlayer / thinking_sound option to play a short “thinking” or typing audio clip while the agent is processing. This provides audible feedback without speaking over the user.
• Injecting custom audio (advanced):
◦ If you absolutely need short sounds played while the user is still speaking, it would require a custom implementation using low-latency event hooks and audio injection. LiveKit uses turn detection to determine when the user finished speaking, and agents don’t normally interrupt that flow—so this approach is advanced and not a built-in behavior.
Trade-offs to consider
• Speaking over the user can degrade turn-detection and natural conversation flow; usually it’s better to wait for end-of-turn and then give a brief acknowledgement.
• Short post-turn replies + background “thinking” audio give the perception of responsiveness while avoiding interruptions and are simpler to implement.
If you want, I can:
• Show a short example of using on_user_turn_completed with session.say() to produce an immediate acknowledgement.
• Describe how to enable and configure `thinking_sound`/`BackgroundAudioPlayer`.
• Discuss what “custom audio injection during speech” would require so you can judge feasibility.
Which of those would help most for your use case?
Sources: Improving voice AI's turn detection with transformers | Pipeline nodes and hooks | LiveKit Documentation | Agent speech and audio | LiveKit Documentation