How richard523/whisperx works
Project type and purpose
• WhisperX is an audio-processing pipeline library and CLI tool for time-accurate automatic speech recognition (ASR). It extends OpenAI’s Whisper by adding:
• Batched inference via the faster-whisper backend
• Voice Activity Detection (VAD) for segmenting speech and reducing hallucination
• Forced phoneme alignment (wav2vec2) to produce word-level timestamps
• Optional speaker diarization (pyannote-audio or silero VAD) to label speakers
File structure
• Top-level:
• setup.py, requirements.txt, README.md → packaging & documentation
• whisperx/ package:
• __main__.py → CLI entrypoint
• SubtitlesProcessor.py → SRT/ASS subtitle formatting
• audio.py → loading & preprocessing audio
• asr.py, transcribe.py → Whisper model loading & batched transcription
• alignment.py → forced alignment wrappers (wav2vec2 via torchaudio/HF)
• diarize.py → speaker diarization pipeline (pyannote or silero)
• vads/ → VAD implementations (pyannote, silero, generic vad.py)
• utils.py, types.py, conjunctions.py → shared helpers, type definitions, silence words
README for additional insights
1. Audio input → VAD segmentation
2. Batched Whisper ASR
3. Phoneme alignment → word-level timestamps
4. Speaker diarization → assign speaker IDs
5. Subtitle & transcript generation
• Lists dependencies (PyTorch, torchaudio, CTranslate2, Hugging Face, pyannote-audio)