JOURNAL
Realtime speech translation with Gemini Live and LiveKit: what the tutorial leaves out
I rebuilt Google's Gemini Live translation tutorial into something that can run unattended for about 100 regular listeners. Here is what the demo gets right, the seven gaps I had to close, what it costs, and what I measured.
On this page
Google's tutorial makes live speech translation look like a weekend project, and the core of it really is: about $2.21 per hour per language, one WebSocket, one model. What the tutorial leaves out is everything that decides whether the thing survives a redeploy, a curious stranger with the link, or a 40-minute talk. I rebuilt it as a small product called Earshot, aimed at about 100 regular listeners, and this is what I learned.
What the tutorial builds
The tutorial by Thor Schaeff of Google DeepMind (source) builds a one-to-many broadcast. A host speaks; each listener picks a language and hears a live spoken translation. The whole app is one Next.js project:
- The host publishes microphone audio into a LiveKit room.
- A listener joins the same room and picks a language.
- The backend starts a translation bridge for that language, if one is not already running. The bridge joins the room as a bot named
translator-<lang>. - The bridge reads the host's audio in 100 ms frames and streams it over a WebSocket to the Gemini Live model
gemini-3.5-live-translate-preview. - Gemini returns translated 24 kHz audio. The bridge publishes it as its own track, and the listener subscribes to that one track only.
Two design choices in the source are worth copying as they are. There is one bridge per language, not per listener, so fifty Spanish listeners cost one Gemini session. And listeners connect with autoSubscribe: false and subscribe to a single translator track, so nobody downloads the other languages.
The transport split is the key idea. WebRTC carries audio between people and the room, where latency and packet loss matter. A plain WebSocket carries audio between the server and Gemini, where the network is reliable.

Where it stops short of production
The tutorial is a demo, and its author says so in the comments. Seven gaps matter once real people depend on it.
| Gap | What happens in the demo | Why it hurts |
|---|---|---|
| In-memory singleton | All bridges live in one global map, with subscriber counts kept by API calls | A restart forgets every bridge; listeners hear silence until they pick a language again |
| One instance only | --max-instances 1, kept warm by a 3-second browser poll | A second instance would add duplicate translator bots to every room |
| Cloud Run service limits | 60-minute request cap, 10-second shutdown notice | Long events are cut; deploys end live sessions |
| Open listener page | Anyone with the link can start any language | Each language is a paid Gemini session, so the link is a spending button |
| No spend cap | No limit per room, in total, or per day | One busy or abusive room sets the bill |
| Leaked subscriber counts | Tab close calls an unsubscribe route the repo does not define | Counts never reach zero, so bridges keep running and billing |
| Session handling | Reconnects with a resumption handle | One production report measured translation pass rate falling from 98% to 65% with resumption, plus silent stalls of 8 to 51 seconds |
Two smaller mismatches: the demo sends 48 kHz audio although the Live Translate docs specify 16 kHz, and it passes a system instruction although the docs say the model accepts none.
What I changed
One always-on instance is enough at this scale, provided it can lose its memory at any moment and recover. Everything else follows from that.
State lives in LiveKit, not in the process. Each listener sets a language attribute on their own participant. A supervisor loop reads rooms and attributes every 1.5 seconds and starts or stops bridges to match. After a crash or a deploy it rebuilds the same picture from scratch. There are no subscriber counts to leak, because nothing counts.
The decision itself is a pure function: rooms and listener languages in, bridges to start and stop out. That makes every limit testable without a network.
Gemini sessions are disposable. The API closes a connection after about ten minutes. The bridge opens a fresh socket every 8 minutes, and also on goAway, on an unexpected close, and when 20 seconds of speech produce no translated audio. It never uses session resumption: translation needs no history, and the one production report I found shows resumption hurting quality.
Bridges heal. A bridge that receives no host audio for 10 seconds resubscribes. After three tries it stops, and the supervisor replaces it.
Spend is capped. Listener tokens can subscribe and set their own attribute, nothing else. A language starts only if the room offers it and a host is present. Three limits are editable at runtime: languages per room, languages running at once, and language-minutes per day.
Short gaps do not cause churn. A language keeps running for 20 seconds after its last listener leaves, which covers page reloads and language switching.
What it costs
Google prices the model at $0.0368 per minute for one target language (pricing, seen 6 November 2026). Each language is its own session, so cost grows with languages and broadcast hours, not with audience size.
| Monthly line (USD) | Cost | Basis |
|---|---|---|
| Gemini Live Translate, 300 language-hours | About 662 | 2.21 per language-hour, upper bound |
| LiveKit Cloud Ship plan | 50 | Includes 150,000 WebRTC minutes (pricing) |
| App and bridge, one small always-on instance | About 30 to 50 | 1 vCPU, 1 GiB |
| Total | About 740 to 760 | Roughly 7.50 per broadcast hour |
That is 100 broadcast hours in three languages for 100 listeners. About 90% of it is Gemini, which has two consequences. The per-room language limit is a pricing control as much as a safety one. And self-hosting LiveKit saves at most the smallest line on the bill.
What I measured
I tested on one machine with a local LiveKit server. An end-to-end script drives a scripted host and a scripted listener over real WebRTC, and checks that the translator joins, that audio and captions arrive, that a second language starts on a switch, that an unlisted language is refused, and that bridges stop after the last listener leaves.
With the Gemini engine and a synthesized English speech sample:
- The first translated audio arrived about 3.3 seconds after speech began.
- A translator joined the room 1.5 to 1.8 seconds after a listener asked for a language.
- A 19.8-second English safety briefing came back as a correct Vietnamese translation, sentence for sentence.
- Bridges stopped 18 seconds after the last listener left.
One lesson cost me an hour. On a machine with several network interfaces, LiveKit advertised a VPN address, and bridges took up to 10 seconds to join or never received audio. Pinning --node-ip fixed it. The address LiveKit advertises must be one every client can reach.
A second lesson: the model stays silent on a test tone. My first end-to-end script published a 440 Hz sine wave, which works for a loopback engine and proves nothing about translation. Tests against the real engine need real speech.
What is still unproven
The model is the largest risk, not the code. gemini-3.5-live-translate-preview is a preview, it accepts no glossary or instructions, and I found no independent quality test for Vietnamese, Korean or Thai.
My own tests are narrow. I have not run sessions long enough to cross a socket rotation under real speech, used real microphones or accents, built the container image, or deployed it anywhere. Earshot is a working rebuild on my machine, not a launched service.
If you are starting from the same tutorial, the order I would suggest is: move bridge state out of the process first, cap spend second, and treat every Gemini session as something that will end without warning. The translation itself is the part you no longer have to build.


Discussion
Comments are reviewed before publication. Your email is kept private.