Real-time voice translation overlay for CS2 (Counter-Strike 2) that translates foreign-language teammates to English using the OpenAI Whisper API.
- Non-intrusive overlay — transparent, draggable window that sits on top of CS2
- Cloud-powered — uses OpenAI Whisper API, no GPU required
- VAC-safe — no game process injection, just a display overlay
- Near real-time — captions arrive after the buffer duration (3 s by default) plus the API round trip
- Multi-language — Whisper detects the spoken language automatically (Chinese, Japanese, Korean, Russian, Spanish, French, German, and more)
- Smart filtering — optionally skips English audio to save API costs
- Desktop app with GUI — settings window with audio device picker and live log panel
- Secure — API key stored in Windows Credential Manager, not in files
- WASAPI loopback — capture speaker/headphone output directly, no virtual cable needed
- Windows 10/11
- Python 3.10+
- OpenAI API key (get one here)
- Internet connection
# Clone the project
git clone https://github.com/danialothman/cs2-translator.git
cd cs2-translator
# Create virtual environment
python -m venv .venv
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtpython app.pyThe settings window opens where you can:
- Enter your OpenAI API key (stored securely in Windows Credential Manager)
- Select an audio device — pick your speakers/headphones as a loopback device to capture game audio, or a microphone for direct input
- Adjust buffer duration — shorter = faster but less context, longer = more accurate
- Toggle "Skip English" — prevents translating English-to-English
- Click Start Translating
You do not need to pick a source language. Whisper detects it for each audio chunk.
The overlay appears on top of your game showing timestamped translations. Drag it to reposition.
The app uses the OpenAI Whisper API which costs $0.006 per minute of audio.
| Mode | Cost | Notes |
|---|---|---|
| Skip English OFF | ~$0.006/min | Single API call per chunk, translates everything |
| Skip English ON | ~$0.012/min for foreign speech | Two calls (detect language + translate); English chunks cost one call |
A typical CS2 session costs well under $1.
All settings are configured through the GUI and persisted in %APPDATA%\CS2Translator\settings.json. The API key is never written to this file. Available options:
- Audio device — any input device or speaker loopback
- Buffer duration — 2-6 seconds of audio per chunk
- Skip English — avoid translating English speech
- Click Refresh to re-scan devices
- Make sure your audio device is connected and enabled in Windows Sound Settings
- Verify your key at platform.openai.com/api-keys
- Make sure you have credits loaded on your account
- Run Python as administrator
- Use borderless windowed mode in CS2 (not exclusive fullscreen)
- Reduce buffer duration (2-3 seconds)
- Check your internet connection
- If the log shows "Translation is falling behind; dropped a stale audio chunk", the API is slower than the audio. The app drops old audio to keep captions current. Turn off "Skip English" to halve the API calls per chunk.
- The message after the colon comes from OpenAI. If it mentions quota, add credits to your OpenAI account.
- This is a known Whisper issue with silence/noise — common hallucinations are filtered automatically
- If it persists, try increasing the buffer duration
The app sends captured audio, including your teammates' voices, to OpenAI for translation. It sends nothing while translation is stopped. OpenAI's API data usage policy governs how it handles that audio.
No. This tool:
- Does not inject code into CS2
- Does not modify game files
- Does not access game memory
- Only displays a window overlay (same as Discord overlay, MSI Afterburner, etc.)
cs2-translator/
├── app.py # Entry point
├── settings_window.py # GUI settings and control window
├── overlay.py # Translation overlay display
├── translator.py # OpenAI Whisper API integration
├── audio_capture.py # Audio device enumeration and capture
├── config_manager.py # Settings persistence (JSON + keyring)
├── docs/ # README screenshots
├── requirements.txt # Python dependencies
├── build.py # PyInstaller build script
├── CONTRIBUTING.md # Architecture, rules and workflow for contributors
├── version.py # App version (bumped by release-please)
├── CHANGELOG.md # Release notes, written by release-please
└── .github/workflows/ # Release PR, .exe build, manual eval
See CONTRIBUTING.md for the architecture, threading rules, commit conventions and how to run the evals.
- OpenAI Whisper API for speech translation
- PyAudioWPatch for WASAPI loopback support
MIT License. See LICENSE.

