I work in meetings where Japanese and English get mixed, and I wanted to read what the other person said while they were still saying it. So I built Twinscript, a desktop app for macOS and Windows. It is MIT licensed.

A Japanese and English meeting turning into text as it is spoken, with the translation next to it

What it does

You pick two languages and press start. Twinscript detects which of the two is being spoken, writes it down, and shows the translation in the other language beside it.

  • It listens to the microphone, to the audio playing on the computer (the other side of a Zoom or Teams call), or to both.
  • The captions can move into a frameless, translucent window that stays on top of other apps, including full-screen slides.
  • Sessions are saved with their audio and can be exported as text, Markdown, CSV or SRT.
  • After a meeting, it can produce a summary with an overview, key points, decisions and action items.
  • You can register company and product names as terms, and fix mishearings with wrong => right rules.

Why there is no server

Twinscript has no server. The app calls Google's Gemini API directly with your own API key.

I chose this for two reasons. The first is cost: there is no subscription, and the only charge is your own API usage. The second is where the meeting goes. Audio and text travel only between your computer and Google, and the transcripts and recordings stay on your computer.

The key is stored encrypted with the operating system's facilities (Keychain on macOS, DPAPI on Windows). The page has a Content Security Policy that blocks connections to anything other than the Gemini API.

The tradeoff is that you have to create a Gemini API key yourself. That is the biggest hurdle to getting started, so I wrote a step-by-step page for it.

How it works

Transcription uses the Gemini Live API (gemini-3.5-transcribe-live) over a WebSocket. Translation streams from gemini-3.5-flash-lite. The interface is plain HTML, CSS and ES modules with no build step, packaged with Electron. There are no runtime dependencies. The same interface runs in a browser, which is how I develop it and run the browser tests.

Audio goes through an AudioWorklet, which produces 16 kHz PCM sent in 100 ms chunks. The recognizer returns interim and final results. I start translating from the interim text and replace the translation once, when the result is final.

Translating the way an interpreter does

The hard part of live translation is being fast and readable at once. To be fast you translate a sentence before it is finished. Japanese puts the verb last, so English built from half a sentence gets rebuilt every time more of it arrives, and the reader sees a line change under their eyes while they are reading it.

Simultaneous interpreters have dealt with this for a long time. I looked at how they work and built four of their habits in.

What an interpreter does What Twinscript does
Translates in units of meaning Cuts speech into sentences and translates each one, so a translation is settled every time a sentence ends
Does not take back what was said While a sentence is being spoken, the translation on screen is kept and continued; only what the rest of the sentence shows to be wrong is changed
Follows the conversation The preceding remarks and their translations are passed along as context
Prepares terms beforehand Registered terms are used for recognition, the glossary and meeting background for translation

The second one made the difference. The app used to redo the translation of the sentence in progress at a fixed interval and replace what was on screen. Now each request carries the translation already shown, and the model is asked to keep it and write on.

Measured, not felt

Tuning this by feel does not work, because every trial has different speech in it. So I built the measuring tools first: the app can record what the speech recognizer returned and when, a script replays that record with the same timing as often as needed, and it counts the delay until a translation appears and how many characters of a shown translation were erased afterwards.

On a record of a 132-sentence meeting, with the old and the new way replayed at the same time:

Before Now
Characters erased after being shown 17,770 4,081
First translation after 3.0 s 2.4 s
Sentences with a translation before they ended 80 of 132 94 of 132

About a quarter as much text is rewritten, more than half of the sentences are never rewritten at all, and nothing got slower.

The tools taught me one more thing. The translation model's answer time for the same request swings between 0.6 and more than 3 seconds depending on the moment. At first that made the new way look slower, and I drew the wrong conclusion once. Comparisons only became trustworthy when both ways were replayed at the same time, under the same conditions.

Five problems

Sentences that never end

In my first version, one utterance stayed on one line and kept growing as long as the person kept talking, because the recognizer only splits on utterances.

I now split the interim text into sentences in the app. Sentence-ending punctuation closes a sentence, and closed sentences go to translation one by one. Each interim result contains the whole utterance so far, so I compare it with the previous one to decide whether it continues the same utterance or starts a new one. This code produced missed and duplicated segments more than once, so I added real recognizer output to the tests.

The 10-minute connection limit

A Live API connection lasts at most 10 minutes, so transcription would stop in the middle of a long meeting.

After 8.5 minutes, the app opens a new connection in the background at the next pause in speech and switches the audio over once it is ready. If no pause comes, it switches at 9.5 minutes.

Captions that scroll away

When the screen moved with every new sentence, the translation was gone before I finished reading it. I added a fixed area at the bottom that holds the sentence being spoken and the few before it. Translations are replaced once, on the final result, rather than on every interim update.

A third language translated into the wrong one

In a Japanese and English meeting, someone spoke Chinese. I wanted Japanese, and sometimes got English. I had left the choice of direction to the translation model.

Now the app decides from the script. Kana means Japanese, and a run of kanji without kana means Chinese. Once the direction is decided, the model is only told the target ("translate into Japanese"). When I passed both the direction rule and the target, the model did not reliably follow one of them, so I send only one. Scripts shared by many languages, such as the Latin alphabet, cannot be decided from the characters alone, and only in that case is the model asked to choose.

macOS permissions lost because of signing

Capturing PC audio on macOS needs the System Audio Recording permission. For a while the permission was granted in Settings and no audio arrived.

The cause was signing. macOS identifies the app that received a permission by its signature. A build without a signing certificate counts as a different app every time, so the permission from the previous version did not carry over. I do not have an Apple developer certificate, so I created a fixed self-signed one and sign every release with it. Permissions now survive updates. The first-launch warning is still there.

Limitations

  • It cannot identify who is speaking.
  • The macOS build is not notarized by Apple, and the Windows build is not signed with a publisher certificate. The OS shows a warning the first time you open it,.
  • PC audio on macOS needs macOS 14.2 or later.

Try it

The code and releases are here: https://github.com/pideoh/twinscript

If you find something that behaves oddly, or a combination of apps and languages that does not work, please open an issue.