Prompt
How do I generate timestamps from audio transcription?
Latest observation
Oct 11, 2026
OpenAI APIWeb search: off
To generate timestamps from audio transcription, you usually need to align the transcript text with the audio. There are a few common ways to do it, depending on what tools you have.
1) Use a speech-to-text model that already outputs timestamps
Many ASR tools can return:
- segment timestamps: start/end time for each chunk of speech
- word timestamps: time for each individual word
Examples:
- OpenAI Whisper / faster-whisper
- Google Speech-to-Text
- AWS Transcribe
- Azure Speech
- AssemblyAI
If you’re using one of these, timestamp generation is often built in.
Example with Whisper-style output
You may get output like:
[
{
"start": 0.0,
"end": 4.2,
"text": "Hello everyone, welcome to the show."
},
{
"start": 4.2,
"end": 8.1,
"text": "Today we'll talk about audio transcription."
}
]
2) If you only have plain text transcript
You can force alignment by comparing the transcript to the audio.
Common alignment approaches:
- Word-level forced alignment: aligns known transcript words to audio
- Phoneme alignment: more precise, often used in research or advanced tools
Tools for forced alignment:
- WhisperX
- Montreal Forced Aligner
- Gentle
- aeneas
These tools take:
- audio file
- transcript text
and return:
- word timestamps
- sentence timestamps
3) Generate timestamps by splitting audio into chunks
If you don’t need exact timestamps, you can:
- split audio into fixed-length chunks, e.g. 10 or 30 seconds
- transcribe each chunk separately
- assign timestamps based on chunk boundaries
This is easier, but less accurate.
4) Best practice: use word timestamps, then build sentence timestamps
If you have word-level times:
- group words into sentences
- sentence start = first word start
- sentence end = last word end
Example:
0.0 Hello everyone,
1.2 welcome to the show.
Sentence timestamp:
- start: 0.0
- end: 1.2
5) Simple Python example with WhisperX
import whisperx
device = "cuda" # or "cpu"
audio_file = "audio.mp3"
model = whisperx.load_model("medium", device)
result = model.transcribe(audio_file)
align_model, metadata = whisperx.load_align_model(
language_code=result["language"],
device=device
)
aligned = whisperx.align(
result["segments"],
align_model,
metadata,
audio_file,
device
)
for seg in aligned["segments"]:
print(seg["start"], seg["end"], seg["text"])
This can give you timestamps at the word level too.
6) Output formats you can generate
You can convert timestamps into:
- SRT
- VTT
- JSON
- CSV
Example SRT
1
00:00:00,000 --> 00:00:04,200
Hello everyone, welcome to the show.
2
00:00:04,200 --> 00:00:08,100
Today we'll talk about audio transcription.
7) What to choose?
- Want easy and good accuracy: use Whisper with timestamps
- Want word-level precision: use WhisperX or forced alignment
- Want simple rough timestamps: split audio into chunks
If you want, I can also show you:
- how to do this in Python,
- how to convert transcripts into SRT/VTT, or
- how to get word-level timestamps with Whisper.