Live caption generator from system audio output for Linux. Features optional real-time translation via web APIs.
There are two ways to install this script. The Automated Installer (Recommended) handles everything for you. The Manual Setup is also available if you prefer doing things yourself.
This method uses the install.sh script to set up everything automatically: system packages, Python virtual environment, VOSK models, and desktop integration.
Download the repository as a ZIP file and extract it, or clone it:
git clone https://github.com/butter-fly04/livecaption_translator.git
cd livecaption_translatorIf you already have VOSK model .zip files downloaded, place them in this folder. The installer will detect and extract them automatically.
Execute the installation script:
chmod +x install.sh
./install.shThe installer will walk you through:
- Installing required system packages (via
apt,dnf, orpacman). - Creating a virtual environment in
~/livecaption/venvand installing Python dependencies. - Downloading VOSK models (or extracting local ones).
- Prompting you to select your default and right-click language pairs.
- Creating a Desktop Entry in your app menu.
Once finished, you can launch "LiveCaption Translator" directly from your application menu!
If you prefer not to use the automated installer, you can set everything up manually.
You will need python3, pip, venv, tkinter, and pulseaudio-utils.
On Debian/Ubuntu:
sudo apt update
sudo apt install python3 python3-pip python3-venv python3-tk pulseaudio-utilsOn Fedora:
sudo dnf install python3 python3-pip python3-tkinter pulseaudio-utilspython3 -m venv venv
source venv/bin/activateYou should see (venv) at the beginning of your terminal prompt.
pip install -r requirements.txt- Visit https://alphacephei.com/vosk/models
- Download the model(s) for your language (e.g., English, Spanish, Chinese, Russian)
- Extract each
.zipfile to a location on your system (e.g.,~/vosk_models/)
Edit live_caption.py and update the VOSK_MODELS section with the full paths to your extracted models:
VOSK_MODELS = {
"en": "/home/username/vosk_models/vosk-model-en-us-0.22",
"es": "/home/username/vosk_models/vosk-model-es-0.42",
"ru": "/home/username/vosk_models/vosk-model-ru-0.10",
}python3 live_caption.py --mode es-enIf you used the Automated Installer, your installation is managed via configuration files in ~/livecaption/.
The default language pair used when you left-click the app menu icon is stored in:
~/livecaption/config.conf
To change your default source or target language, simply open this file in a text editor:
[defaults]
source = en-us
target = es
[actions]
# Format: source->target,source->target
pairs = ru->en, es->en-usSave the file. The next time you launch the app, it will use your new default languages.
If you want to add, remove, or change the language pairs available in the right-click menu of your app icon:
- Open
~/livecaption/config.confin a text editor. - Find the
[actions]section and edit thepairsline. Example:pairs = ru->en, es->en-us, fr->en - Save the file.
- Run the desktop updater script from your terminal:
~/livecaption/update-desktop.shThis regenerates the .desktop entry, and your right-click menu will instantly reflect the new language pairs!
The installer places a file named livecaption.desktop in ~/.local/share/applications/.
- Left-click: Executes
~/livecaption/launcher.shwith no arguments, causing it to readconfig.confand launch your default pair. - Right-click (Actions): Executes
~/livecaption/launcher.sh <source> <target>, overriding the config file for that specific session.
If you are running the script manually (Method 2), or want to create your own custom shortcuts, here are the available arguments:
--mode: Language code from your VOSK_MODELS (e.g.,en,es,ru, ores-ento enable translation)-d / --device: PulseAudio source name (default: monitor of default sink)--list-devices: List audio sources and exit
All visual customization is done by editing the "CUSTOMIZE THESE" section in live_caption.py.
| Option | Default | Purpose | Example |
|---|---|---|---|
BASE_WIDTH |
1400 |
Window width in pixels | 1400 |
BASE_HEIGHT |
150 |
Window height in pixels | 150 |
WINDOW_SIZE_PERCENT |
70 |
Scale factor (100 = base, 150 = 1.5x, 50 = 0.5x) | 100 for full size |
WINDOW_OPACITY |
0.93 |
Transparency (0.1 = very transparent, 1.0 = opaque) | 0.7 for more transparent |
MAX_LINES |
3 |
Maximum number of caption lines displayed at once | 5 |
SHOW_ONLY_TRANSLATION |
True |
Hides the source-text pane and halves window width | False to show original text |
Note: Opacity may not work on all window managers. Language codes follow ISO 639-1 (2-letter codes: en = English, es = Spanish, zh = Chinese, ru = Russian).