How petergilles/luxasrlive works
Live ASR gateway streams browser audio over WebSocket, applies VAD, repeatedly decodes a growing PCM window with Whisper, and commits stable text while retaining a partial tail. Committed text can optionally be translated through Ollama; the browser presents transcription and translation panes and supports microphone or loopback capture. The gateway is the orchestration layer for sessions, buffering, decoding, commit policy, and translation. Internal gateway stages are documented in the README and excerpts; some implementation details are unsampled, so those relationships rely on the README where noted.
Main entry points: ws_gateway.py WebSocket sessions · client.js Capture and controls · whisper_engine.py Whisper engine · translation.py Ollama translation
Components 14
Browser client
- Microphone / loopback
static/client.js - Capture and controls
static/client.js - Caption panes
templates/index.html
Stream gateway
- WebSocket sessions
ws_gateway.py - Silero VAD
ws_gateway.py - Growing PCM buffer
ws_gateway.py - Decode context
ws_gateway.py - Text post-processing
ws_gateway.py
Recognition
- Whisper engine
whisper_engine.py - LocalAgreement-N
local_agreement.py
Translation
- Translation client
ws_gateway.py - Ollama translation
utils/translation.py
Other components
- User
- Ollama
Connections 15
- User → Microphone / loopback: starts capture
README.md - Microphone / loopback → Capture and controls: provides audio
README.md - Capture and controls → WebSocket sessions: streams PCM
README.md - WebSocket sessions → Silero VAD: checks speech
README.md - WebSocket sessions → Growing PCM buffer: appends PCM
README.md - WebSocket sessions → Decode context: gets context
ws_gateway.py - WebSocket sessions → Whisper engine: decodes window
ws_gateway.py - Whisper engine → LocalAgreement-N: filters words
whisper_engine.py - WebSocket sessions → LocalAgreement-N: commits prefix
ws_gateway.py - WebSocket sessions → Text post-processing: processes text
ws_gateway.py - WebSocket sessions → Translation client: translates commits
ws_gateway.py - Translation client → Ollama translation: requests translation
ws_gateway.py - Ollama translation → Ollama: sends chat request
utils/translation.py - WebSocket sessions → Capture and controls: sends results
README.md - Capture and controls → Caption panes: renders captions
README.md