Audio version — Estimated duration: 9 min 14 sec
Configuration
All settings in Whisper Dictate are variables at the top of the script (lines 28-44 in whisper-dictate-v2.py). You can change any of them with a text editor before running the script.
Config Location
Open whisper-dictate-v2.py and look for the section starting with:
# ── Config ────────────────────────────────────────────────────────────────────
HOTKEY_CODE = "KEY_RIGHTALT"
MODEL_SIZE = "medium"
...
MIN_DURATION = 0.3
# ─────────────────────────────────────────────────────────────────────────────Everything above the separator line is configurable.
Quick Reference Table
| Variable | Default | What It Controls |
|---|---|---|
HOTKEY_CODE | "KEY_RIGHTALT" | Which keyboard key triggers recording |
MODEL_SIZE | "medium" | Whisper model size (accuracy vs speed) |
SAMPLE_RATE | 16000 | Audio capture rate (don’t change unless you know what you’re doing) |
DEVICE | "cuda" | GPU ("cuda") or CPU ("cpu") for transcription |
COMPUTE_TYPE | "int8_float16" | How model weights are stored (memory usage vs speed) |
LANGUAGE | None | Spoken language (None = auto-detect) |
SHOW_NOTIFY | True | Desktop pop-ups on/off |
MIN_DURATION | 0.3 | Minimum recording time in seconds (filters accidental taps) |
HOTKEY_CODE — Choose Your Hotkey
Default: "KEY_RIGHTALT"
This is the key you hold to dictate. Any key on your keyboard can be used.
Common Hotkeys
| Code | Physical Key | Notes |
|---|---|---|
KEY_RIGHTALT | Right Alt | Default — convenient for thumb |
KEY_RIGHTCTRL | Right Ctrl | Also easy for thumb |
KEY_CAPSLOCK | Caps Lock | You won’t accidentally hit it |
KEY_F9 | F9 | Function row — unlikely to conflict |
KEY_RIGHTMETA | Right Super/Win | Usually opens app menu — beware conflicts |
KEY_LEFTMETA | Left Super/Win | Usually opens app menu — beware conflicts |
KEY_COMPOSE | Compose/Menu key | Often unused |
KEY_LEFTCTRL | Left Ctrl | May conflict with Ctrl+C, Ctrl+V, etc. |
How to Find Your Key Code
python3 -m evdev.evtestThis opens an interactive key tester. Press the key you want to use and look for the KEY_* name printed to the terminal. For example, pressing the Right Alt key shows:
Event: time 12345.678901, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
The code name (KEY_RIGHTALT) is what you put in your config.
Best Practices
- Avoid modifiers used by applications — Left Ctrl conflicts with copy/paste shortcuts, Super/Windows key opens menus
- Use a key you can press with your non-dominant hand — You’ll be holding it for several seconds while speaking
- Avoid keys you type frequently — You don’t want to accidentally start recording while typing normally
MODEL_SIZE — Accuracy vs Speed
Default: "medium"
Whisper comes in several sizes. Larger models are more accurate but slower and use more VRAM (video memory).
Model Comparison
| Size | Parameters | Speed (RTX 3050) | VRAM | Accuracy | Best For |
|---|---|---|---|---|---|
tiny | 39 million | ~1 second | ~1 GB | Lowest | Quick commands, low-end GPUs |
base | 74 million | ~2 seconds | ~1 GB | Medium | Balanced on limited hardware |
small | 244 million | ~3 seconds | ~2 GB | Good | Everyday use on 4GB GPUs |
medium | 769 million | ~5 seconds | ~5 GB | Great | Default — best for 6GB GPUs |
large-v3 | 1.55 billion | ~10 seconds | ~10 GB | Best | Maximum accuracy, high-end GPUs |
How to Choose
- Check your GPU memory: Run
nvidia-smiand look at the “Memory-Usage” for your GPU. - Pick the largest model that fits: If you have 6GB VRAM like an RTX 3050,
mediumis the sweet spot.large-v3requires 10GB+. - CPU users: Use
tinyorbase— transcription takes 5-20x longer on CPU.
Storage
Models are cached in the ./models/ directory in your project folder. Space used:
| Model | Disk Space |
|---|---|
| tiny | ~300 MB |
| base | ~600 MB |
| small | ~2 GB |
| medium | ~6 GB |
| large-v3 | ~12 GB |
DEVICE — GPU or CPU
Default: "cuda"
Controls whether transcription runs on your NVIDIA GPU or on your CPU.
| Value | Hardware | Speed |
|---|---|---|
"cuda" | NVIDIA GPU (requires CUDA toolkit) | Fast |
"cpu" | System CPU | 5-20x slower |
GPU Notes
- You need an NVIDIA GPU with at least 4GB VRAM for
smallor larger models - CUDA toolkit must be installed:
nvidia-smishould show driver version - If you get “CUDA out of memory” errors, try a smaller model or switch to CPU
CPU Notes
- Works on any system, even without a GPU
mediummodel takes ~1-2 minutes on a modern CPUtinymodel takes ~5-10 seconds on CPU- The script will still work for dictation, just with a delay between releasing the key and text appearing
COMPUTE_TYPE — Memory Quantization
Default: "int8_float16"
This controls how model weights are stored in GPU memory. Different formats trade off VRAM usage against speed and accuracy.
| Type | VRAM Saved | Speed | Notes |
|---|---|---|---|
"int8" | Most | Fast | Slight accuracy loss |
"int8_float16" | Medium | Fast | Default — good balance, safe for RTX 3050 |
"float16" | Some | Fastest | May cause NaN/infinity errors on some GPUs |
"float32" | None | Slowest | Full precision, rarely needed outside research |
If you see NaN errors or incorrect output: Switch to "int8_float16" or "int8". Some GPUs have issues with full float16.
If you have limited VRAM and need a larger model: Use "int8" — it reduces model size the most.
LANGUAGE — Auto-Detect or Fixed
Default: None
None = automatic language detection. Whisper listens to the first 30 seconds of audio and determines the language on its own. This adds ~0.5 seconds to transcription.
Set a specific language code to skip detection and improve accuracy:
| Code | Language |
|---|---|
"en" | English |
"hi" | Hindi |
"mr" | Marathi |
"es" | Spanish |
"fr" | French |
"de" | German |
"zh" | Chinese |
"ja" | Japanese |
"ko" | Korean |
When to set a language:
- You always speak the same language
- Auto-detection adds noticeable delay
- Whisper confuses your language with a similar one (e.g., Ukrainian with Russian)
Full list: https://github.com/openai/whisper/blob/main/whisper/tokenizer.py
SHOW_NOTIFY — Desktop Notifications
Default: True
Controls whether desktop pop-ups appear for recording status.
| Value | Behavior |
|---|---|
True | Show notifications (requires libnotify-bin) |
False | No notifications, terminal output only |
Notification events:
- Model loading (startup)
- “Ready” (model loaded)
- “Recording…” (hotkey pressed)
- “Transcribing…” (hotkey released)
- “Typed” (text injected)
- “Copied to clipboard” (fallback used)
- “Nothing detected” (too short or no speech)
MIN_DURATION — Accidental Tap Filter
Default: 0.3
The minimum recording duration in seconds. If you press and release the hotkey in less than this time, nothing is transcribed.
Why this exists: You might accidentally brush the hotkey while typing normally. Without this filter, every accidental tap would trigger a transcription of silence or background noise.
Recommendations:
0.3— Good default. Filters accidental taps, doesn’t interfere with intentional use0.5— More aggressive filtering, requires a deliberate press0.1— Minimal filtering, captures even brief utterances
Internal Variables (Not User-Configurable)
These are set inside the code and affect behavior:
| Variable | Default | Purpose |
|---|---|---|
_stream_interval | 2.0 | Seconds between live preview transcriptions during recording |
_stream_idx | 0 | Tracks which audio chunks have been previewed; resets each recording |
_lock | threading.Lock() | Thread safety lock — prevents race conditions |
You can change _stream_interval if you want more or less frequent live previews. A shorter interval (e.g., 1.0) gives more real-time feedback but uses more GPU time. A longer interval (e.g., 5.0) conserves GPU resources but shows less feedback.
Best Practices Summary
| Goal | Settings |
|---|---|
| Fastest transcription | MODEL_SIZE = "tiny", COMPUTE_TYPE = "int8_float16", LANGUAGE = "en" |
| Highest accuracy | MODEL_SIZE = "large-v3", COMPUTE_TYPE = "float16", LANGUAGE = "en" |
| Low VRAM usage | MODEL_SIZE = "tiny", COMPUTE_TYPE = "int8" |
| CPU-only system | DEVICE = "cpu", MODEL_SIZE = "tiny" |
| Quiet operation | SHOW_NOTIFY = False |
Now see common-issues if you run into issues, or components to understand how each config option is used internally.