New Tool Radar

Local AI

How to Get Word and Segment Timestamps from an MLX Whisper Transcription

Turn on word_timestamps in mlx-whisper so each segment and word in the transcript carries start and end times you can use for subtitles.

Schematic diagram with three steps: transcribe audio with mlx-whisper, turn on word timestamps, and read start and end times for each word in the output.

A plain transcript tells you what was said, not when. For subtitles, for jumping to a moment in a recording, or for lining a transcript up with audio, you need timestamps. The mlx-whisper README documents exactly one switch for this: word_timestamps=True on the transcribe function.

Turn timestamps on

import mlx_whisper

output = mlx_whisper.transcribe("audio_file.mp3", word_timestamps=True)
print(output["segments"][0]["words"])

Each segment in the output carries a start and end time, and with word timestamps on, each word inside a segment carries its own start and end time. The README gives help(mlx_whisper.transcribe) for the full option list. If you only need segment times, leave the flag off: segment-level start and end come with the normal output.

Use the times

Write the segments to a subtitle file, or print them in a readable form:

for segment in output["segments"]:
    print(f"[{segment['start']:.2f}s -> {segment['end']:.2f}s] {segment['text']}")

Check the first few times against the audio by hand before you trust the whole file: play the recording, find the word at the printed time, and confirm it matches. Word times are estimates from the model, and they drift on fast speech, overlapping voices, or long silences. For plain transcription without times, see the separate guide on transcribing audio with faster-whisper.

Check What you should see If you do not see it
Words carry times Each word has a start and end time word_timestamps was left off — pass word_timestamps=True
Segment times present Each segment has start and end times You read the wrong key — segments live under output[“segments”]
Times match the audio A spot-checked word lines up with the recording Timestamps drift on fast or overlapping speech — treat them as approximate

Expected result. We checked the mlx-whisper README for the word_timestamps=True example and the output["segments"][0]["words"] access pattern. We did not run mlx-whisper, so the output shape above is UNTESTED on this machine.

Limits

Word timestamps are model estimates, not a precise alignment: they can be off by a noticeable margin on difficult audio. Turning them on also costs extra compute. This runs on Apple silicon only.

Sources

Sources checked 2026-11-28.

See all