New Tool Radar

Local AI

How to Get Word-Level Timestamps from faster-whisper

Pass word_timestamps=True to faster-whisper's transcribe and read each word's start, end, text, and probability from the words array.

Schematic diagram with three steps: transcribe with word_timestamps set to True, read each word's start, end, text, and probability, then check the times rise in order and re-listen to low-probability words.

faster-whisper is a reimplementation of OpenAI’s Whisper model using CTranslate2, which the project’s README describes as up to 4 times faster than openai/whisper for the same accuracy while using less memory. By default its transcribe method returns segments with a start time, an end time, and text. Pass word_timestamps=True and each segment also carries a words list, so you can find out exactly when each word was spoken — and how sure the model was about it. This guide uses the faster-whisper Python library, not the openai-whisper command line: the subtitles guide covers the command line’s --word_timestamps flag for SRT files, while this one reads the word data in Python.

Turn on word timestamps

Install the library with pip install faster-whisper, then transcribe with the flag on. This follows the README’s own word-level timestamps example, with the CPU setup from the same README:

from faster_whisper import WhisperModel

model = WhisperModel("base", device="cpu", compute_type="int8")
segments, _ = model.transcribe("practice-note.wav", word_timestamps=True)
for segment in segments:
    for word in segment.words:
        print("[%.2fs -> %.2fs] %s (%.2f)" % (word.start, word.end, word.word, word.probability))

Two things the README warns about: segments is a generator, so the transcription only starts when you iterate over it — the words only exist inside the loop, or after gathering the segments into a list. And the four fields on each word come from the project’s own Word type: start and end in seconds, word as text, and probability as the probability assigned to that word.

Find the words you should re-listen to

Print the words and look at the probabilities. A word with a high probability is one the model settled on; a word with a low probability — say below 0.50 — is one to check against the original audio at the printed start time. That is the practical use of the probability field: instead of re-listening to the whole recording, you re-listen to the few words the model was unsure about, and fix the transcript there.

Check What you should see If you do not see it
Words present Each segment has a words list with entries segment.words is empty or missing — word_timestamps=True was not passed
Times rise Word start times increase through the segment, in order The words are not aligned — check that you iterated the segments the README’s way
Text matches Joining the word.word values gives the segment’s text A word is missing from the loop — print every word in segment.words
Low probability A few words sit below 0.50, and re-listening at their start times confirms or corrects them Every word is below 0.50 — the audio may be unclear, or try a larger model size

Expected result. We checked faster-whisper’s README for the word-level timestamps example, the CPU with INT8 setup, and the generator warning, and the project’s own transcribe.py for the Word fields start, end, word, and probability. We did not run faster-whisper.

Limits

The times are estimates produced during transcription, so treat them as approximate and re-listen before quoting a time or correcting a word. The probability field is the model’s own confidence for that word, not an independent check — a confident word can still be wrong, which is why the check is against the audio. Turning the flag on adds a words list to every segment; without it, there is no per-word timing at all. The practice-note.wav file and the base model are practice examples, not a measured test. We did not run faster-whisper, so no output here is a recorded result.

Sources

See all