Technology

Forced alignment

Karsten B. Kreh Karsten B. Kreh Updated on

Also known as: text-audio alignment

Forced alignment is a method that lays an already known text onto a recording word by word and determines the start and end in time for each word. The method does not recognise new text. It answers only the question of when each word of the given text was spoken. The result is word timestamps.

How it works

Whisper delivers its text in sections of a few seconds, each with a start and an end time. Radford et al. (2022, section 4.5) describe that the model predicts its own time tokens for this, after which the 30-second window advances. Bain et al. (2023) note that these time values per section can be inaccurate and that timestamps per word are not readily available.

The WhisperX project therefore adds a second step (Bain et al., 2023). A second model of the type wav2vec2 recognises the smallest sound units in the recording, the phonemes, and states for each short time slice which sound is probable. A search procedure lays the text from Whisper onto this sequence so that the sounds of the words fit as well as possible in the right order. The start and end of each word follow from this. Because the sound models are language-specific, each language needs its own alignment model. One is preset for German, English, French, Spanish and Italian.

wav2vec2 comes from Baevski et al. (2020). The model first learns speech features from unlabelled audio and is then adapted to sounds or letters with a small amount of labelled material.

What it is used for

Without word timestamps, an editor can only jump to the start of the whole section when a word is clicked. With them, playback jumps exactly to the place where the word begins, and the text can be read along word by word during playback. Speaker diarization also needs the time for each word: every word receives the speaker in whose time section it falls.

Limits

Forced alignment can only align what is in the text. If a word is missing from the transcript, it finds no timestamp for it either. If an invented word is in the transcript, the method still looks for a place for it and often finds a neighbouring one. A timestamp therefore does not prove that the word was spoken.

Alignment becomes difficult with numbers and abbreviations, because “14” as a numeral has no sounds that the model can assign. Boundaries also become less precise with simultaneous speech and strong reverberation.

Relevance for working on the transcript

memozero uses the alignment from WhisperX when recognition runs through faster-whisper, which is the case on Windows with an NVIDIA graphics card. With MLX on the Mac and with whisper.cpp, the word timestamps come from the recognition model itself. The app stores every timestamp in milliseconds. If a section with text has no word timestamps, the app distributes the words evenly over the duration of the section as a fallback, so that no text is lost. At such places, playback jumps less precisely.

For the check this means: the timestamp shows where you have to listen. Listening decides whether the word was spoken there.

Frequently asked questions

Is forced alignment a second speech recognition?

No. It does not change the text and recognises no new words. It determines only the time of the existing words.

Why does playback sometimes jump slightly too early or too late?

Word boundaries are not sharp in continuous speech, and with numbers, abbreviations and overlap the alignment works less precisely. A short run-up when playing compensates for this.

Does forced alignment work in every language?

Only in languages for which a suitable sound model exists. WhisperX ships with five languages preset, and for others you look for a model on Hugging Face.

Sources

  1. Bain, M., Huh, J., Han, T., Zisserman, A. (2023): WhisperX: Time-Accurate Speech Transcription of Long-Form Audio. Interspeech 2023. https://arxiv.org/abs/2303.00747
  2. m-bain (n.d.): whisperX, README. Accessed 2 October 2026. https://github.com/m-bain/whisperX
  3. Baevski, A., Zhou, H., Mohamed, A., Auli, M. (2020): wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations. NeurIPS 2020. https://arxiv.org/abs/2006.11477
  4. Radford, A., Kim, J. W., Xu, T., Brockman, G., McLeavey, C., Sutskever, I. (2022): Robust Speech Recognition via Large-Scale Weak Supervision. arXiv:2212.04356. https://arxiv.org/abs/2212.04356