Inspiration
Mega tech conferences like Nerdearla host more than 30 concurrent stages simultaneously. Providing professional live closed captioning and human translation across multiple languages for this scale is logistically unfeasible, prohibitively expensive (costing tens of thousands of dollars per day), and introduces unacceptable latency (often 10–20 seconds behind the speaker).
We built LOCE (LiveVoice Open-Caption Engine) to democratize real-time accessibility. Our vision is a resilient, open-source, broadcast-grade captioning and translation engine that can ingest live audio from 32+ stages simultaneously, translate it into 8 languages concurrently, and deliver sub-15ms broadcast latency with zero vendor lock-in.
What it does
LOCE is a distributed, high-density captioning and translation system designed for conference centers, live broadcasts, and edge deployments:
- Ultra-Low Latency Streaming: Ingests live PCM audio (16kHz 16-bit mono) via persistent WebSockets and dispatches partial/final captions within milliseconds ($P95 < 12\text{ ms}$).
- Hybrid AI Inference Architecture:
- Cloud: Powered by the Gemini Live Multimodal API for hyper-accurate technical terminology, automatic punctuation, and real-time contextual translation.
- On-Premise / Air-Gapped: Native support for local execution with Gemma 4 (
gemma4:2b,gemma4:4b, and unified 12B) with 256k-token context windows for completely private, zero-egress environments.
- Concurrent Octalingual Translation: Simutaneously translates technical talks into 8 languages: English, Spanish, Portuguese, French, German, Italian, Russian (Cyrillic), and Chinese (Simplified CJK).
- High-Density NOC Matrix: A specialized engineering dashboard capable of orchestrating and monitoring 32+ concurrent stages, stream metrics, packet throughput, and end-to-end latencies in real time.
- Dual Consumption Channels:
- Audience Second-Screen (
/): High-contrast, mobile-first, WCAG AAA-compliant live reader with dynamic font scaling. - Broadcast Overlay (
/overlay/:roomId): Alpha-channel transparent video overlays for OBS Studio and vMix with real-time word-level anti-jitter rendering.
- Audience Second-Screen (
- Standard Post-Event Export: One-click instant generation of synchronized WebVTT (
.vtt) and SubRip (.srt) files with millisecond timestamps for instant publishing on YouTube and replay archives.
How we built it
- Core & Backend: Python 3.12, FastAPI, and low-level
asyncioroutines. Audio frames are processed through ring buffers and dispatched usingasyncio.shieldto avoid connection leaks and task orphanages. - Frontend & NOC Dashboard: React 19, TypeScript, Vite, Tailwind CSS, and Lucide Icons. Designed with zero-layout-shift typography specifically tuned for CJK ideograms and Cyrillic scripts.
- Deployment & Edge Infrastructure: Multi-stage Dockerized backend deployed on Render; single-page static application deployed on Vercel with dynamic client-side API injection and automatic fallback.
Challenges we ran into
- Backpressure & Concurrency Under High Load: Handling 192 concurrent WebSockets across 32 stages required fine-tuning our frame-drop policies and non-blocking queues to prevent memory accumulation.
- Translation Word Jitter: Streaming live partial tokens often leads to visual flickering on screen. We developed a rolling anti-jitter reconciliation algorithm that locks committed tokens and smooths incremental updates for video overlays.
- Typography for Global Scripts: Rendering dynamic Chinese ideograms and Russian Cyrillic without causing container reflow required custom CSS line-clamp and break-all text wrapping primitives.
Accomplishments that we're proud of
- Stress-Tested at Scale: Validated 31 concurrent stages and 186 simultaneous WebSockets achieving an overall $P50$ latency of 5.22 ms and $P95$ latency of 7.65 ms with a 100% pass rate.
- 100% Test Coverage on Core Ingestion: 39 passed pytest unit and integration suites testing memory shields, DoS resilience, and path sanitization.
- Zero-Egress Sovereignty: Seamless plug-and-play compatibility with Gemma 4 local weights via Ollama/vLLM, allowing air-gapped venues to operate without external internet.
What we learned
We gained deep insights into Web Audio API downsampling, binary PCM streaming over WebSockets, delta token alignment for live machine translation, and architecting systems with graceful degradation when transitioning between cloud multimodal models and compact edge LLMs.
What's next for LOCE
- Direct digital output translation via real-time speech synthesis (Voice-to-Voice).
- Native RTMP / SRT video ingestion to automatically embed CEA-608/708 closed captions directly into broadcast SDI/NDI pipelines.
- Hardware-accelerated local Gemma 4 embeddings for live glossaries and speaker voice diarization.
Built With
- asyncio
- docker
- fastapi
- gemini-api
- gemini-live
- gemma-4
- python
- react
- render
- tailwindcss
- typescript
- vercel
- vite
- web-audio-api
- websockets
Log in or sign up for Devpost to join the conversation.