Overview
WhisperX is a speech-recognition pipeline built around OpenAI's Whisper model. Plain Whisper produces accurate text but only gives timestamps at the utterance level, and those can be off by several seconds; it also has no native batching. WhisperX fixes both problems by wrapping Whisper in a four-stage pipeline — voice-activity detection, batched inference, forced phoneme alignment, and speaker diarization.
The alignment stage is what gives WhisperX its name recognition. After Whisper produces a transcript, a phoneme-based model in the wav2vec2 family is used to align the orthographic text back onto the audio, which yields a start and end time for every individual word rather than for each whole segment. A separate diarization stage, using pyannote-audio, partitions the audio by speaker and attaches a speaker label to each segment.
Because inference runs through the faster-whisper backend with VAD-based batching, the project reports roughly 70x realtime transcription using Whisper large-v2 while fitting in under 8 GB of GPU memory at beam size 5. WhisperX was accepted at INTERSPEECH 2023 and took first place in the Ego4d transcription challenge.
What it does
- Batched inference on the faster-whisper backend — the project reports ~70x realtime with Whisper large-v2
- Word-level timestamps produced by forced phoneme alignment against wav2vec2 models
- Multi-speaker transcription: speaker diarization via pyannote-audio attaches speaker IDs to segments
- VAD preprocessing that trims silence, reduces hallucination, and enables batching without degrading WER
- Sentence-level transcript segments (via nltk sentence tokenization) for cleaner subtitles
- Command-line entry point plus subtitle output, including a --highlight_words flag that visualises word timings in the .srt
Getting started
WhisperX ships on PyPI. GPU acceleration needs the CUDA toolkit installed first; CPU-only use can skip that step. Speaker diarization additionally requires a Hugging Face read token and acceptance of the pyannote model's user agreement.
Install from PyPI
The simplest install is the published wheel. You can also run it without installing via uvx.
pip install whisperxTranscribe an audio file
Point the CLI at any audio file. With default parameters this uses the small Whisper model; add --highlight_words True to visualise word timings in the generated .srt.
whisperx path/to/audio.wavEnable speaker diarization
Generate a read token at huggingface.co/settings/tokens and accept the user agreement for the speaker-diarization-community-1 model, then pass the token with --hf_token to get speaker labels alongside the transcript.
whisperx path/to/audio.wav --hf_token YOUR_HF_READ_TOKENInstall from source instead
For development work, clone the repository and sync the environment with uv. The development version may contain experimental features; use the PyPI release in production.
git clone https://github.com/m-bain/whisperX.git
cd whisperX
uv sync --all-extras --devCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Generate subtitle files where each word is timed precisely enough to karaoke-highlight during playback
- Transcribe multi-speaker recordings — interviews, panels, meetings — with a speaker label on every segment
- Batch-process a large archive of audio on a single GPU, where plain Whisper's lack of batching makes the job too slow
- Build a dataset of word-aligned speech for training or evaluating downstream audio models
How WhisperX compares
WhisperX alongside other open-source audio, music & voice tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Whisper | ★ 109k | OpenAI's speech recognition model that transcribes and translates audio across many languages. |
| GPT-SoVITS | ★ 61.7k | An open-source WebUI that clones a voice from a short audio sample and turns text into speech, with zero-shot and few-shot fine-tuning. |
| VibeVoice | ★ 54.2k | Microsoft's text-to-speech model for generating long, expressive multi-speaker audio like podcasts. |
| whisper.cpp | ★ 53.6k | A dependency-free C/C++ port of Whisper built on ggml, running speech recognition on CPU, Metal, CUDA, Vulkan and NPUs from phones to servers. |
| Voicebox | ★ 53k | Local-first voice studio that clones a voice from a short sample, generates speech across seven TTS engines and 23 languages, handles system-wide dictation, and speaks for agents over MCP. |
| Coqui TTS | ★ 46k | A library of text-to-speech models including the multilingual XTTS voice-cloning model. |
| ChatTTS | ★ 39.8k | ChatTTS is an open-source text-to-speech model tuned for dialogue, with multi-speaker support and fine-grained control over laughter, pauses, and prosody. |
| WhisperX | ★ 24k | Batched Whisper transcription with word-level timestamps and speaker labels |