WhisperX setup in Google Colab with speaker detection
Learn to set up WhisperX on a Colab T4 GPU, add speaker labels and word timestamps, and export JSON, SRT, TXT, TSV and VTT transcripts.
Player not loading? Watch on YouTube
This tutorial explains how to transcribe audio or video with WhisperX in Google Colab. The demonstrated workflow runs on a hosted GPU through the browser; it does not run models locally or require installation on the viewer's computer. The presenter says prior coding experience is unnecessary.
Setup begins with a Hugging Face account, a read access token and access to pyannote.audio’s gated speaker-diarization-community-1 model. The tutorial then selects a T4 GPU in Colab and stores the token in a notebook secret with notebook access enabled. WhisperX runs inside a uv virtual environment, with cuDNN packages and environment variables configured to address dependency conflicts. The presenter warns that Colab updates can cause package compatibility problems.
The example uses an English, two-speaker test.m4a recording generated with NotebookLM. The command selects large-v2, enables pyannote speaker diarization and specifies a word alignment model. Speech transcription and word alignment come from the WhisperX workflow, rather than the diarization model. The presenter examines speaker labels and word timestamps in JSON, then checks the SRT output. Other exports include TXT, TSV and VTT.
Word timestamps can support per-word captions or later silence removal, though this tutorial does not demonstrate the editing step. The presenter reports processing a 30-minute recording in under three minutes. That is a reported result for this example, rather than a general performance guarantee.