Live Translator
A live interpreter for meetings, in one HTML file. People talk; each sentence shows up with its translation, and the newest one is the biggest, like a subtitle.
Live demo: https://agrawaladitya270.github.io/Live-Translator/ (desktop Chrome, allow the microphone)
What it does
- Speech to text with the browser's Web Speech API. It listens continuously, shows the words as you speak, and restarts itself when the browser ends a session.
- Translates each finished sentence with one of three engines (see below), so the transcript keeps going even when translation is slow or off.
- 8 languages: Japanese, English (American, British, Indian or Australian accent), Chinese, Korean, Hindi, German, French and Spanish. Any one can be translated into any other.
- Built for a laptop on a meeting table: big text for the newest line, a text size slider, a dark mode, and the screen stays awake while it listens.
- Keeps the transcript: the last 600 lines are saved in the browser. You can copy them all or download them as a
.txt file with timestamps.
- Keys: Space starts or stops listening, S swaps the two languages.
Translation engines
| Engine | Where it works | Notes |
|---|
| Claude | When the page is opened as a Claude artifact on claude.ai | Best quality, also with technical words. Uses your Claude plan. |
| On-device | Desktop Chrome (built-in Translator API) | Free, and the text stays on your computer. It downloads a language pack the first time you use a language pair. |
| Off | Everywhere | Transcript only. |
On GitHub Pages there is no Claude runtime, so the Claude option is greyed out and the page uses on-device translation.
How the Claude engine is used
- Lines are sent in batches of up to 8, at most one request every 2.5 seconds, so a fast speaker doesn't cause a flood of calls.
- Each request includes the last 3 translated lines as context, and an optional meeting topic and glossary you type in Settings (names, product names, how to translate technical terms).
- The prompt tells Claude the text comes from speech recognition: guess the intended word, keep names and numbers exact, and drop filler like えーと or "um".
- Claude replies with a JSON array, one string per line, so every translation lands next to the right sentence.
- Errors: if you hit a rate limit or your sign-in expires, translation pauses and a banner offers Resume (or the on-device engine). After 3 failures in a row it pauses too. Speech is still written down the whole time.
Try it
Online: open the live demo in desktop Chrome, allow the microphone, and press Start.
Locally: the browser only lets a page use the microphone over https or localhost, so serve the folder instead of double-clicking the file:
git clone https://github.com/agrawaladitya270/Live-Translator.git
cd Live-Translator
python -m http.server 8000
# open http://localhost:8000
There's nothing to install or build. The only outside files are two Google Fonts.
Browser support
| Browser | Speech to text | On-device translation |
|---|
| Chrome (desktop) | Yes | Yes |
| Edge (desktop) | Yes | No, so you get the transcript only |
| Chrome (Android) | Yes, one phrase at a time | No |
| Firefox | No | No |
How it works
microphone → Web Speech API → finished sentence → queue → translator → transcript (saved in the browser)
└─ words so far, shown live
- Long sentences are cut after 15 seconds, or 110 characters in Japanese, Chinese or Korean (280 in other languages), so translations keep coming while someone talks for a long time.
- Words are never lost: if the speech engine stops before it finishes a sentence, the words it had so far are saved as a line.
- Reconnecting: after a network error it waits a bit longer each time (up to 8 seconds) and stops after 6 failures in a row. If it restarts more than 8 times in 10 seconds, it slows down.
- Repeats are skipped: if the same line comes in twice within 4 seconds, only one copy is kept.
Privacy
- The browser's speech service turns speech into text, and it runs online (Google in Chrome, Microsoft in Edge). Your audio leaves the computer. Don't use this in meetings that must stay private.
- On-device translation keeps the text on your computer.
- Claude translation sends the text and your meeting topic to Claude.
- The transcript and settings are kept only in this browser's
localStorage. Clear in Settings deletes them.
Project layout
index.html the whole app: HTML, CSS and JavaScript, no build step
docs/ screenshots for this README
License
MIT. See LICENSE.