Local speech recognition & synthesis

Align Korean subtitles and speaker labels with WhisperX

Forced alignment matches a transcript to audio and adds word-level start and end times.

WhisperX transcribes audio, aligns word-level timings with a separate model, and can create SRT subtitles. It can also diarize speakers, but the pyannote model requires accepting its access terms. Review the output against the audio, especially names, numbers, and overlapping speech.

Requirements and key details
  • WhisperX runs a word-timing alignment step after transcription.
  • For Korean, the default aligner is kresnik/wav2vec2-large-xlsr-korean.
  • Review speaker labels and SRT timings against the actual recording.

Why use word-level timestamps

WhisperX transcribes a recording, then uses an alignment model to estimate where each word falls in the audio. Word-level segments make it easier to fix only the captions that drift in a subtitle editor. Alignment matches text that it receives to speech, so a transcription error can still receive a timestamp.

Run transcription and alignment on a short Korean WAV file. Check the sentence text and each word's start and end times, then correct misrecognized words first. Running alignment again with the corrected text makes it easier to find the subtitle segments to fix.

An audio waveform displayed on a laptop beside a microphone
Transcribe the audio first, then align its word timings.

Save subtitles using the Korean aligner

First install ffmpeg and place recording.wav in the working folder. The commands below are for macOS and Debian or Ubuntu Linux. Then install PyTorch1 and WhisperX in your Python environment.

Install ffmpeg on macOS and Debian/Ubuntu
# macOS
brew install ffmpeg

# Debian / Ubuntu Linux
sudo apt-get update && sudo apt-get install -y ffmpeg
Install WhisperX packages
python -m pip install torch torchaudio
python -m pip install whisperx
Save Korean SRT with word-level highlighting
whisperx recording.wav --output_dir whisperx-output --language ko --model large-v2 --compute_type int8 --device cpu --highlight_words True

Place recording.wav in the current folder and run the command to save whisperx-output/recording.srt and the transcript. Set --language ko for Korean; WhisperX then calculates word timings with its Korean alignment settings.

Complete model access before adding diarization

Speaker diarization2 assigns a speaker ID to each recording segment. Accept the access conditions on the pyannote model card used by WhisperX, then prepare a Hugging Face read token3. In macOS or Linux Bash, the command below keeps the token off screen and uses it only in the current shell.

For a conversation with two participants, add --min_speakers 2 --max_speakers 2 to provide the expected speaker count. These values guide the model as it finds segment boundaries. Overlapping speech or brief acknowledgements may be merged or assigned a different ID, so listen again and check the labels.

Add speaker IDs and word highlighting
read -rs HF_TOKEN
printf '\n'
export HF_TOKEN
whisperx recording.wav --output_dir whisperx-output --language ko --model large-v2 --compute_type int8 --device cpu --diarize --min_speakers 2 --max_speakers 2 --highlight_words True --hf_token "$HF_TOKEN"
A desk with headphones, a microphone, and a transcription workspace
Check the recording before relying on speaker labels.

Review the SRT while playing the recording

Open whisperx-output/recording.srt with the WAV file in a subtitle editor and correct the text and timecodes. Checking numbers, names, and overlapping speech first makes it easier to distinguish alignment errors from transcription errors.

A speaker ID is a number that distinguishes speakers, not a person's name. Before adding names to meeting notes, listen to the audio again and keep the WAV and SRT files according to the permissions granted by participants and your organization.

A recorder, notes, and headphones for reviewing speech recognition
Open the SRT in an editor and check caption start and end times.

Terminology notes

  1. PyTorch — A software framework for building and running AI models. Check the compatible PyTorch version and hardware support along with the model.

    Back to the text
  2. Speaker diarization — The task of dividing a recording into who-spoke-when segments and labeling them by speaker.

    Back to the text
  3. Token — A unit into which a model divides input or output for processing.

    Back to the text

Frequently asked questions

What should you check first in this article?
WhisperX transcribes audio, aligns word-level timings with a separate model, and can create SRT subtitles. It can also diarize speakers, but the pyannote model requires accepting its access terms. Review the output against the audio, especially names, numbers, and overlapping speech.
Where can you check the conditions and sources?
Speaker diarization assigns a speaker ID to each recording segment. Accept the access conditions on the pyannote model card used by WhisperX, then prepare a Hugging Face read token. In macOS or Linux Bash, the command below keeps the token off screen and uses it only in the current shell.