# How to transcribe podcast audio (WhisperX with speaker diarization)

Original: https://swyx.io/transcribe-podcasts-with-whisper
Published: 2023-02-24

> Note: sometimes WhisperX is WAAYYYY too slow so I often end up using https://github.com/ggerganov/whisper.cpp which somehow runs much faster.

> Note: sometimes WhisperX is WAAYYYY too slow so I often end up using https://github.com/ggerganov/whisper.cpp which somehow runs much faster.

I do a lot of podcast transcription work and had need for it again today. The HuggingFace spaces (like this one https://huggingface.co/spaces/vumichien/whisper-speaker-diarization) always error out so aren't very useful. 

This is the one that worked for me.

> Note: if you run into a [New error: 'soundfile' backend is not available error](https://github.com/m-bain/whisperX/issues/132), `conda install -c conda-forge libsndfile` to fix.

0. make sure you have the `.wav` for your podcast audio. you can use quicktime or audacity to convert it. this process doesnt work for mp3
1. `pip3 install git+https://github.com/m-bain/whisperx.git` this will take a couple minutes. meanwhile...
2. Read https://github.com/m-bain/whisperX#voice-activity-detection-filtering--diarization. To enable VAD filtering and Diarization, include your Hugging Face access token that you can generate from [Here](https://huggingface.co/settings/tokens) after the --hf_token argument and accept the user agreement for the following models: [Segmentation](https://huggingface.co/pyannote/segmentation) , [Voice Activity Detection (VAD)](https://huggingface.co/pyannote/voice-activity-detection) , and [Speaker Diarization](https://huggingface.co/pyannote/speaker-diarization). make sure to accept them all in your huggingface account.
4. `whisperx YOUR_AUDIO_FILE.wav --hf_token YOUR_HF_TOKEN_HERE --vad_filter --diarize --min_speakers 3 --max_speakers 3 --language en` for 3 speakers in English. remember it must be a .wav file.

![image](https://user-images.githubusercontent.com/6764957/221219413-e83cec72-3164-40ad-bd48-0ca41616f224.png)


It takes about 30 seconds to transcribe 30 seconds so be prepared for it to take the time of your audio podcast to transcribe.

![image](https://user-images.githubusercontent.com/6764957/221219791-a78b3a39-47d5-47ab-9377-7f89c19bf142.png)
