Plain Whisper is great at turning speech into text, but its timestamps can be off by several seconds and it can’t tell who is speaking. WhisperX fixes both problems.
WhisperX is a free, open source tool built on Whisper. It gives you word-level timestamps, speaker labels and batched transcription that the project says runs up to 70x faster than real time with large-v2 on a GPU.
This guide shows how to install WhisperX on Windows, Linux or Mac, transcribe your first file, make accurate subtitles, label speakers, use it from Python and fix the usual errors. It follows the official WhisperX README and command-line options as of November 2026 (version 3.8.x).
- What: Whisper plus word timestamps (wav2vec2 alignment), speaker labels (pyannote) and fast batching (faster-whisper).
- Install:
pip install whisperx(Python 3.10 to 3.13). For NVIDIA GPUs, install CUDA 12.8 first. - Transcribe:
whisperx audio.mp3 --model large-v2. - Speakers: add
--diarize --hf_token YOUR_TOKENafter accepting the pyannote model terms. - CPU or Mac:
--device cpu --compute_type int8. - Low VRAM: lower
--batch_size, use a smaller model orint8.
What WhisperX Adds to Whisper
| Feature | OpenAI Whisper | WhisperX |
|---|---|---|
| Timestamps | Per segment, can drift by seconds | Per word, via wav2vec2 forced alignment |
| Speed | Sequential | Batched, up to 70x real time (large-v2, GPU) |
| Speaker labels | No | Yes, with pyannote-audio |
| VAD (voice detection) | No | Yes, reduces hallucinations |
| Backend | PyTorch Whisper | faster-whisper (CTranslate2) |
| VRAM for large-v2 | About 10 GB | Under 8 GB with beam size 5 |
| License | MIT | BSD-2-Clause |
The project’s research paper was accepted at INTERSPEECH 2023, and a 2026 update added context-aware batching for better punctuation and names in long audio. If you just want simple Whisper first, see our run Whisper locally guide.
What You Need
- Python 3.10, 3.11, 3.12 or 3.13. WhisperX 3.8 doesn’t support 3.14 yet.
- ffmpeg on your PATH, to read MP3, MP4 and other formats.
- NVIDIA GPU (optional): install the CUDA toolkit 12.8 before WhisperX. Under 8 GB of VRAM is enough for large-v2.
- A free Hugging Face account if you want speaker labels.
- CPU or Mac: works, just slower. Use
int8.
Install WhisperX
- Install CUDA 12.8 (NVIDIA only) from NVIDIA’s site. Skip this on CPU or Mac.
- Install ffmpeg. Windows:
winget install Gyan.FFmpeg. Mac:brew install ffmpeg. Ubuntu:sudo apt install ffmpeg. - Make a virtual environment so WhisperX’s PyTorch version doesn’t clash with other tools:
python -m venv whisperx-env # Windows whisperx-env\Scripts\activate # Linux / Mac source whisperx-env/bin/activate - Install WhisperX from PyPI:
pip install whisperx - Optional speed-up: install Numba for 30x to 100x faster alignment on long files:
pip install "whisperx[fast]" - Check it works:
whisperx --version.
Prefer uv? Run it without a permanent install with uvx whisperx. Developers can clone the repo and run uv sync --all-extras --dev.
Transcribe Your First File
The simplest command uses the default small model and writes every output format to the current folder:
whisperx interview.mp3
For better accuracy, pick a bigger model and an output folder:
whisperx interview.mp3 --model large-v2 --output_dir out --output_format srt
| Output format | Use it for |
|---|---|
srt |
YouTube, Premiere, most video editors |
vtt |
Web players and HTML5 video |
txt |
Plain transcript |
tsv |
Spreadsheets |
json |
Word timings, speakers and scripts |
all (default) |
Everything at once |
No NVIDIA GPU? Run on the CPU (this is also the route on a Mac):
whisperx interview.mp3 --device cpu --compute_type int8
Make Word-Accurate Subtitles
WhisperX aligns every word, so subtitles stay in sync even in fast speech.
- Highlight words as they’re spoken (karaoke style) in SRT and VTT:
whisperx video.mp4 --model large-v2 --highlight_words True -f srt - Keep lines short for phones and Shorts with
--max_line_width 42 --max_line_count 2. - Help with names and jargon using
--hotwords "ComfyUI, Ollama, LoRA"or an--initial_prompt. - Improve long audio with
--interleaved_context, which passes context between segments. - Load the SRT into your editor and spot-check numbers and names.
One known limit: words without letters in the alignment model’s dictionary, like “2014.” or “£13.60”, can’t be aligned and get no timing. Adding --suppress_numerals makes Whisper spell numbers out so they align. For more subtitle workflows, see our Whisper subtitles guide.
Label Speakers (Diarization)
Diarization splits the audio by who is speaking and tags each line SPEAKER_00, SPEAKER_01 and so on. It uses a gated pyannote model, so set up access first.
- Create a Hugging Face read token at huggingface.co/settings/tokens.
- Accept the user agreement on the
pyannote/speaker-diarization-community-1model page while logged in. - Run with diarization:
whisperx meeting.wav --model large-v2 --diarize --hf_token hf_xxx - Tell it the speaker count if you know it, for better results:
--min_speakers 2 --max_speakers 2. - Rename speakers in the output (SPEAKER_00 to “Host”, for example) with find and replace.
The README is honest that diarization “is far from perfect”, and overlapping speech is hard for both Whisper and WhisperX. Expect to fix a few labels by hand.
Other Languages and Translation
Alignment needs a language-specific wav2vec2 model. WhisperX picks it automatically. English, French, German, Spanish and Italian come from torchaudio, and many more come from Hugging Face.
whisperx talk.mp3 --model large-v2 --language de
- Set the language with
--languageto skip detection and avoid wrong guesses on short clips. - Translate to English with
--task translate. - Unsupported language for alignment? Use
--no_alignto get segment timestamps without word timing.
Use WhisperX in Python
The Python API runs the same three steps: transcribe, align, then assign speakers.
import whisperx
from whisperx.diarize import DiarizationPipeline
device = "cuda" # or "cpu"
audio = whisperx.load_audio("audio.mp3")
# 1. Transcribe (batched)
model = whisperx.load_model("large-v2", device, compute_type="float16")
result = model.transcribe(audio, batch_size=16)
# 2. Align words
model_a, meta = whisperx.load_align_model(language_code=result["language"], device=device)
result = whisperx.align(result["segments"], model_a, meta, audio, device)
# 3. Speaker labels
diarize = DiarizationPipeline(token="hf_xxx", device=device)
result = whisperx.assign_word_speakers(diarize(audio), result)
for s in result["segments"]:
print(s.get("speaker"), s["start"], s["text"])
On a small GPU, delete each model and call torch.cuda.empty_cache() between steps, as the README suggests.
To save results, loop over result["segments"] and write your own SRT, or keep using the command line, which already writes SRT, VTT, TXT, TSV and JSON for you. Each word in the aligned output has its own start, end and score, which is handy for cutting clips or building karaoke-style captions.
Useful Options Cheat Sheet
| Option | Default | What it does |
|---|---|---|
--model |
small | Whisper size: tiny, base, small, medium, large-v2, large-v3 |
--batch_size |
8 | Higher is faster but uses more VRAM |
--compute_type |
default | float16 on GPU, int8 to save memory |
--device |
auto | cuda or cpu |
--vad_method |
pyannote | Or silero |
--chunk_size |
30 | Lower it if segments are too long |
--model_dir |
~/.cache/whisper | Where models are saved |
--output_format |
all | srt, vtt, txt, tsv, json |
--diarize |
off | Adds speaker labels |
Example: Podcast to Speaker-Labelled Transcript
Say you have a one-hour, two-person podcast and want a clean transcript plus captions for clips.
- Run one command:
whisperx podcast.mp3 --model large-v2 --diarize --hf_token hf_xxx --min_speakers 2 --max_speakers 2 --interleaved_context -o out - Open
out/podcast.txtfor the transcript andpodcast.srtfor captions. - Rename SPEAKER_00 and SPEAKER_01 to the hosts’ names.
- Cut clips using the word timestamps in
podcast.json.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| CUDA out of memory | Batch too big for your GPU | --batch_size 4, a smaller model, or --compute_type int8 |
| Runs on CPU despite a GPU | CPU-only PyTorch or no CUDA 12.8 | Install CUDA 12.8 and reinstall in a fresh venv |
| Diarization 401 or “gated repo” | Terms not accepted or bad token | Accept the pyannote model terms and pass a valid read token |
| ffmpeg not found | ffmpeg missing from PATH | Install ffmpeg and open a new terminal |
| pip fails on Python 3.14 | Unsupported Python | Use Python 3.10 to 3.13 |
| Numbers have no timing | Alignment can’t match digits | Use --suppress_numerals |
| Speech missed in quiet parts | VAD threshold too high | Lower --vad_onset and --vad_offset |
| Repeated or invented lines | Hallucination on silence or music | Keep VAD on, set --language, trim long silences |
| Wrong speaker labels | Overlapping speech | Set min and max speakers, then fix by hand |
GPU memory trouble in general? Our CUDA out of memory fix covers drivers and VRAM checks.
FAQ
Is WhisperX free?
Yes. It’s open source under the BSD-2-Clause license and runs on your own machine.
Is WhisperX better than Whisper?
For subtitles and meetings, usually yes. It keeps Whisper’s text quality but adds word timestamps, speaker labels and much faster batching.
How much VRAM does WhisperX need?
Under 8 GB for large-v2 with beam size 5, per the README. Smaller models and int8 need less.
Can WhisperX run on a Mac?
Yes, on the CPU with --device cpu --compute_type int8. It won’t use the Apple GPU.
Why does diarization need a Hugging Face token?
The pyannote speaker model is gated. You accept its terms once, then pass a read token.
Which model should I use?
large-v2 is what the README benchmarks. Use small or medium on weak hardware, and test large-v3 for your language.
Can WhisperX translate audio?
Yes. --task translate turns other languages into English text.



