Hello everyone, Title: High Latency in Unity + Liv...
# inference
g
Hello everyone, Title: High Latency in Unity + LiveKit (Mumbai) + Gemini Native Audio Streaming Hi Team, We are building a real-time AI voice assistant using the following architecture: Unity (Mic Input) ↓ LiveKit Cloud (Mumbai region) ↓ Python Agent (hosted on local machine) ↓ (streaming audio) Gemini model: gemini-2.5-flash-native-audio-preview-12-2025 ↓ (streaming audio response) Python Agent ↓ (publish audio immediately) LiveKit ↓ Unity playback Issue: We are experiencing ~3–4 seconds delay before AI response audio starts playing in Unity. Observations: - Direct Gemini API testing shows low latency. - Latency increases only when routing through Python agent + Gemini. - Audio is streamed (not waiting for full transcript). - Audio is published back immediately upon receiving chunks. Questions: 1. Are there recommended audio frame sizes for low-latency streaming with Gemini native audio? 2. Are there specific LiveKit or WebRTC buffering parameters recommended for Unity? 3. Could local agent hosting cause additional latency compared to AWS? 4. Is there a best-practice architecture for achieving sub-1.5s response start time? Our target is response audio starting within ~1–1.5 seconds. Any guidance would be greatly appreciated. Thanks.
l
We recently published a guide to creating performant voice agents in India: https://livekit.io/field-guides/guide/building-performant-voice-agents-india. It talks about the pipeline model rather than realtime but the advice is relevant. It sounds like you are already considering the overall geographical distribution of your solution, but it still might be worth experimenting with some of the advice in that guide. 1.5s is agressive, but should be achievable with the right stack.
before AI response audio starts playing in Unity
I'm sure you are taking account of this, but obviously the start of the first audio would also require the agent to join the room, introducing an initial delay