we are getting this error when switching to gemini...
# ask-ai
f
we are getting this error when switching to gemini-2.5-flash-native-audio-preview-12-2025
livekit.agents._exceptions.APIConnectionError: Failed to connect to Gemini Live
google.genai.errors.APIError: 1007 None. Cannot extract voices from a non-audio
t
Thanks for reaching out, Dmitry. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding about the two errors you posted when switching to the model `gemini-2.5-flash-native-audio-preview-12-2025`: •
APIConnectionError: Failed to connect to Gemini Live
and •
google.genai.errors.APIError: 1007 None. Cannot extract voices from a non-audio
. To help diagnose and fix this, please confirm these items and share the requested details so I can pinpoint the root cause: 1. Environment & auth ◦ Are you setting
GOOGLE_API_KEY
in the environment where the agent runs? (This is required for Gemini Live.) ◦ Are you running locally, in CI, or on a cloud host? Any corporate firewall / proxy / NAT that could block WebSocket/WebRTC? 1. Media configuration ◦ Is the agent configured to use audio modalities? (Confirm
modalities
includes
"AUDIO"
and that
audio_input=True
is enabled in your Room/agent options.) ◦ Are you using WebRTC audio tracks from the LiveKit room? Confirm the participant actually publishes an audio track and that LiveKit
RoomOptions
allows audio. 1. Payload/stream details ◦ Is the data sent to Gemini actually audio (PCM/Opus via WebRTC) or might a binary/text message have been routed to the audio stream by mistake? The
1007
error means non-audio data was presented where audio was expected. ◦ Are you using any custom transcoders/recorders or changing codecs that could corrupt the audio stream? 1. Logs & repro ◦ Share minimal server/client logs around the time of the error (WebSocket connect attempts, any WebRTC track events, agent debug logs). ◦ If possible, share a short reproducible sequence: steps to switch model, how the audio track is attached, and exact code/config snippets for the agent/room setup (mask any secrets). Quick troubleshooting steps to try now • Verify
GOOGLE_API_KEY
is present and valid. • Confirm the participant publishes an audio track in the LiveKit room and
audio_input
is enabled. • Ensure
modalities
includes
"AUDIO"
for the Gemini model. • Run a connection test for WebSocket/WebRTC/TURN (see the connection test utility) to rule out network blocking: https://kb.livekit.io/articles/3972989092-diagnosing-connection-errors-with-connectionchecker If you send the environment, relevant config snippets, and the small log excerpt requested above, I’ll review them and provide the next concrete fix. Sources: Diagnosing Connection Errors with Connection Test Utility, with interactive elements
f
when was this model added to livekit? which version
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
f
give me example using this model gemini-2.5-flash-native-audio-preview-12-2025