In `livekit-agents` library, does "thinking_sound"...
# ask-ai
m
In
livekit-agents
library, does "thinking_sound" of BackgroundAudioPlayer work with Realtime models? The "ambient_sound" works just fine, but the "thinking_sound" does not work at all with
google.beta.realtime.RealtimeModel
("gemini-live-2.5-flash-preview"). My intuition was that RT models do not have "thinking" state and therefore the sound is not played, but when I logged
@session.on("agent_state_changed")
it appeared that RT models do indeed enter thinking state too, so now I'm confused as to whether or not it's disabled through another way.
t
Thanks for reaching out, Hugo. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! I wanted to share some info about the "thinking_sound" feature in the
BackgroundAudioPlayer
from the LiveKit Agents library. Currently, this feature isn’t supported for Realtime models like
google.beta.realtime.RealtimeModel
when using the Node.js (TypeScript) implementation. This is because it relies on
AudioMixer
support, which helps manage multiple audio sources at once. So, if you add a "thinkingSound" option during initialization, you’ll see a gentle warning saying: "thinkingSound is not yet supported." On a brighter note, the Python implementation of LiveKit Agents does fully support "thinking_sound" for Realtime models—it automatically plays the configured sound whenever the agent is in the "thinking" state, which is pretty handy! If you’re working with Node.js and really want this feature, you might consider switching to the Python version or creating your own audio cues based on when the agent’s state changes. Please feel free to reach out if you’d like some help with that or have any other questions—I’m here for you! Sources: plugins/google/README.md | livekit-agents/livekit/agents/voice/background_audio.py | Gemini Live API plugin | LiveKit docs
m
Omg, the sound is actaully there but the recording volume was too low, my bad. I'm so sorry.