talira

WhisperX

Automatic Speech Recognition with Word-level Timestamps (& Diarization)

open sourceBSD-2-Clauseself-hostablefree

WhisperX is a Python library and command-line tool by Max Bain that adds word-level timestamps and speaker labels to Whisper transcription. It runs batched Whisper inference on a faster-whisper backend (70x realtime with large-v2 on a GPU, per its README), aligns words with wav2vec2 phoneme models, cuts audio with voice activity detection to reduce hallucination, and assigns speakers with pyannote's speaker-diarization-community-1 pipeline. Diarization needs a Hugging Face token and acceptance of that gated model's conditions; the models then run on your own machine. It's GPU-oriented (CUDA); on a Mac its README runs it on the CPU.

Problems it solves

  • transcribe audio in Python with word-level timestamps and speaker labels
  • Whisper's timestamps drift by seconds, I need accurate per-word timings in my transcripts
  • add speaker diarization to Whisper transcripts from a script
  • transcribe hundreds of recordings in a batch job on my own GPU server
  • make karaoke-style subtitles with per-word highlighting from speech
  • run speech recognition with speaker labels on our own hardware instead of a cloud API
  • Whisper hallucinates text in silences on long recordings, I need speech detection first
  • plain Whisper is too slow on long files, I need batched transcription
  • merge pyannote speaker turns with Whisper's words without writing the glue code
  • tell the transcriber how many speakers a recording has to improve the speaker labels
  • script interview transcription with speaker labels so the audio stays on our machines
  • a command-line tool that writes SRT subtitles with speaker IDs

Features

  • batched Whisper inference on faster-whisper (70x realtime with large-v2, per its README)
  • word-level timestamps by wav2vec2 forced alignment
  • speaker diarization with pyannote speaker-diarization-community-1
  • voice activity detection preprocessing
  • min and max speaker counts
  • interleaved context for punctuation and proper nouns on long audio
  • SRT output with highlighted words
  • default alignment models for English, French, German, Spanish and Italian, more through Hugging Face
  • optional Numba-accelerated alignment
  • CPU mode with int8 compute

Limitations

  • Doesn't handle overlapping speech well: its README lists overlapping speech and imperfect diarization as limitations1
  • Doesn't diarize without a Hugging Face token: you must accept the gated pyannote speaker-diarization-community-1 model's conditions1
  • Doesn't use the GPU on macOS: its README runs it on Mac OS X with --device cpu --compute_type int81

Capabilities

Has a command line toolplan not known
Has official SDKsplan not known

Alternatives

The same job

These do what WhisperX does.

  1. AssemblyAI Speech-to-text, speech understanding and text-to-speech APIs for voice AI
  2. Deepgram Speech-to-text, text-to-speech and voice agent APIs
  3. ElevenLabs AI voice generator, text to speech, speech to text and voice agents
  4. Meetily Privacy-first AI meeting assistant that records, transcribes and summarizes meetings on your device

Compare WhisperX with the top 3