Real-time captions for the browser. Capture tab/screen audio, transcribe with Deepgram, translate with Google Cloud, and show a live overlay for multilingual accessibility.
- Web app that captures tab/screen audio in the browser
- WebSocket backend that streams audio chunks for transcription and translation
- Live caption overlay in the frontend
- Translation cache + queue control to keep latency low
- The user starts tab/screen audio capture in the frontend.
- Audio is converted to 16-bit mono PCM and sent in short chunks via WebSocket.
- The backend processes each chunk:
- Transcription with Deepgram.
- Translation with Google Cloud Translation (Service Account or API Key).
- The frontend receives captions and displays them in real time.
- Node.js 18+ (20+ recommended)
- Deepgram account with API Key
- Google Cloud Translation enabled (API Key or Service Account)
- Install dependencies:
npm install
npm run install:all- Create the backend
.envfile (do not commit):
cd backend
copy .env.example .env- Fill in sensitive variables in
backend/.env:
DEEPGRAM_API_KEYTRANSLATE_PROJECT_ID(if using Service Account)TRANSLATE_API_KEY(if using API Key)GOOGLE_APPLICATION_CREDENTIALS(path to the Service Account JSON)
Use API Key or Service Account (ADC). At least one of these options is required for translation.
- Run locally:
cd ..
npm run dev- Backend (WebSocket):
ws://localhost:8080 - Frontend:
http://localhost:5173
Note: tab/screen capture requires a secure context; localhost is allowed.
DEEPGRAM_API_KEY: Deepgram credential (STT)DEEPGRAM_MODEL: Deepgram model (defaultnova-3)DEEPGRAM_LANGUAGE: base/detection language (defaultmulti)TRANSLATE_PROJECT_ID: GCP project (using Service Account)TRANSLATE_API_KEY: alternative to Service AccountPORT: backend port (default8080)TARGET_SAMPLE_RATE: 16000 recommendedMAX_QUEUE: queue limit per clientTRANSLATE_INTERIM: enables partial translation (defaultfalse)INTERIM_TRANSLATE_INTERVAL_MS: partial translation interval
backend/
server.js
audio.js
config.js
translate.js
.env.example
frontend/
index.html
src/
App.jsx
main.jsx
styles.css
- For production, configure TLS and a secure origin in the backend.
- Tune
TARGET_SAMPLE_RATEand chunk size to balance cost vs latency.
Issues and PRs are welcome. If you plan a larger change, open an issue first to align on approach.