I've been watching a lot of foreign films lately, and I hit the same wall most people do: subtitles are fine until you're trying to enjoy a visual scene, and dubbed versions usually sound like someone read it off a script. Then I realized — what if my computer could just... dub movies for me? Live?
So I built one. It's called LiveDub, and it runs entirely on your machine after the initial setup. No data ever leaves your PC once everything's downloaded. Here's how it works and what went into building it.
The architecture
It's a chain of four steps, each one feeding into the next:
- Audio capture — A browser extension grabs whatever audio is playing in a tab (YouTube, Netflix, local video files through VLC or any player). It pipes that straight to Whisper for transcription.
- Speech-to-text — OpenAI's Whisper model runs locally via an API call from the app. You get raw text back in whatever language the content was spoken in.
- Translation — That text gets sent to LM Studio's local LLM (any small model works; I use a ~2GB one). The model translates it into your target language while preserving context and tone as best it can.
- Text-to-speech — A neural voice model reads the translated text aloud. Here's where things get interesting...
Speaker switching with pitch detection
This was the trickiest part. When a scene has multiple characters, you want them to sound different. In professional dubbing, a male actor voices male characters and a female actress voices female characters. I wanted something similar.
The solution is surprisingly simple: measure the audio pitch of each speaker's voice. Male speech generally sits lower in frequency (around 85-180 Hz), while female speech tends higher (165-255 Hz). The app measures the dominant pitch during each speaking segment and switches between a male and female TTS voice accordingly.
It's not perfect — there are edge cases with deeper-sounding women and lighter-sounding men, but it works well enough that you notice the difference without being distracted by it. Which is exactly what you want from dubbing.
The natural delay problem
People sometimes ask why their favorite scene doesn't get dubbed instantly. The answer is straightforward: you can't translate something until someone finishes saying it. You need at least a sentence or two of buffer to capture complete thoughts, feed them through Whisper and the translation model, then synthesize speech back.
That's not a limitation of my approach — every professional dubbing studio works the same way. It's just physics and language structure. A human translator can't translate mid-sentence either; they wait for natural breaks in the dialogue. My app does the same thing, it just happens at machine speed rather than with a team of translators.
What you need to run it
- Windows (it's built on Windows-specific audio APIs)
- Python 3.10+ — comes bundled in the installer, so if you don't have Python installed already that's fine
- LM Studio (free download from lmstudio.ai) — this handles your local translation model
- One small LLM (~2GB) — I tested with Qwen 2.5 and it works well; anything under 3GB should be fine
- A GPU helps but isn't required — everything runs on CPU too, just slower for the larger models
The whole thing is a one-time $5 purchase on Gumroad. No subscription, no cloud API calls after setup, nothing to maintain. It's built as a Windows app with a browser extension that does the heavy lifting of audio capture from your tabs.
What I learned building this
A few things surprised me:
- Whisper is fast enough for real-time use. I was worried about transcription latency eating into the experience, but on modern hardware it's barely noticeable compared to the translation step.
- Local LLMs are good enough for rough translations. They're not going to match a human linguist, but they capture meaning and context well enough that you can follow along with almost anything. The goal here is "understand what's being said," not "publish this in a theater."
- Audio ducking matters more than I expected. Having the original soundtrack drop to 30% volume while the dub plays through makes a huge difference. Without it, you're fighting two audio sources and neither comes through clearly.
Try it out
If any of this sounds useful to you, it's available on Gumroad for $5. It's a straightforward download-and-install setup. Grab LM Studio (free), drop in your model (~2GB), and start dubbing whatever you're watching.
I'm genuinely excited about where this kind of local-first media tool is heading. The tech exists now to handle voice data entirely on your own hardware — no cloud dependency, no privacy concerns, just a computer doing what it's always been good at: processing data.
Top comments (0)