Sub topic 13
Checking captions against the audio
This chapter covers how to review an AI-drafted caption file before it reaches learners. It assumes you can read short Python scripts and have seen a WebVTT file. You should also know what a draft caption file is and why it needs a human check. Earlier chapters covered drafting captions and the accessibility requirements for them.
Why captions need a check against the audio
A caption draft usually comes from automatic speech recognition (ASR), which turns audio into text and timestamps. The result often looks clean. It has punctuation, line breaks, and plausible sentences. That polish hides errors, because a wrong word reads just as smoothly as a right one.
Two kinds of error matter:
- Text errors. The words differ from what the speaker said.
- Timing errors. The words are right but appear too early, too late, or too briefly.
A script can check some timing rules. It cannot tell whether the text matches the audio. Only a person listening can do that, so the review combines an automated pass with a listening pass.
The sample file
The examples below use the draft from the drafting chapter.
WEBVTT
00:00:00.000 --> 00:00:03.200
Welcome to the course. Today we build a budget.
00:00:03.200 --> 00:00:07.000
Start by entering your income in column B.A WebVTT file starts with the line WEBVTT. Each cue (one caption unit) has a start time, the arrow -->, an end time, and one or more lines of text. A blank line separates cues.
Step 1: Run the automated timing check
Run the structural check first. It is fast and removes mechanical problems before you spend time listening.
import re
TIME = re.compile(r"(\d+):(\d{2}):(\d{2})\.(\d{3}) --> (\d+):(\d{2}):(\d{2})\.(\d{3})")
def seconds(h, m, s, ms):
return int(h) * 3600 + int(m) * 60 + int(s) + int(ms) / 1000
def check_vtt(text):
problems = []
last_start = -1.0
for n, line in enumerate(text.splitlines(), 1):
m = TIME.search(line)
if not m:
continue
start = seconds(*m.groups()[:4])
end = seconds(*m.groups()[4:])
if end <= start:
problems.append(f"line {n}: end is not after start")
if start < last_start:
problems.append(f"line {n}: cue starts before the previous cue")
last_start = start
return problemsThis function flags two problems: a cue that ends before or when it starts, and a cue that starts before the previous one. It does not check that the words match the audio. It does not check that a cue stays on screen long enough to read.
An empty list means "no mechanical timing errors found." It does not mean "the captions are correct." Treat a clean result as permission to start listening, not as approval.
Step 2: Listen and correct the text
Play the video with captions on. Pause often. Compare what you hear with what you read, one cue at a time. Work at normal speed first, then slow down for any cue that sounds off.
Start with the errors ASR makes most often:
- Names and brand terms. A product or person's name may be spelled as a similar common word.
- Technical vocabulary. Terms such as "SUM," "cell range," or "pivot table" may become near-homophones.
- Numbers and units. "Fifteen" and "fifty" sound alike. Dates, prices, and cell references like
B2:B6are easy to garble. - Homophones. "Their" and "there," or "write" and "right," may be swapped.
- Dropped or added words. Negatives such as "not" or "don't" are sometimes lost, which reverses the meaning.
- Speaker changes. A new voice may be merged into the previous cue without any label.
- Non-speech sound. If a sound carries meaning, such as a warning tone, the captions should say so.
Keep a short term list for the course. Check every cue that contains a term from the list against the correct spelling, even when it sounds fine in context.
A worked example
Suppose the draft contains this cue, and the speaker actually said "Start by entering your income in column B, not column D."
00:00:03.200 --> 00:00:07.000
Start by entering your income in column B and column D.The timing is valid, and the sentence is grammatical. But the draft changed "not" to "and" and reversed the instruction. A learner who relies on captions would enter data in the wrong place. A timing script would never find this. Only listening does.
The corrected cue is:
00:00:03.200 --> 00:00:07.000
Start by entering your income in column B, not column D.Step 3: Correct the timing
After the words are right, check when they appear. A cue should show as the speaker begins the phrase and clear shortly after they finish.
Common timing problems:
- Drift. Captions start in sync and slowly fall behind or run ahead. This often means the caption file was made from a different cut of the video, or the video was edited after captioning.
- Early or late cues. A cue appears before the speech or after it, so the captions confuse the on-screen action.
- Too fast to read. A long cue is squeezed into under a second or two.
- Too long on screen. A cue stays up while the speaker has moved on.
- Overlaps. Two cues show at the same time and stack on the screen.
Two numbers help you judge readability. A cue should usually stay on screen for at least about one second. Reading speed is often held to roughly 17 to 20 characters per second for general audiences, but your organization or platform may set its own limit. Check the guidance you are bound by instead of relying on these figures alone.
You can extend the check to report reading speed. This script adds a characters-per-second measure and a minimum duration, using the same time format as the earlier check.
import re
TIME = re.compile(r"(\d+):(\d{2}):(\d{2})\.(\d{3}) --> (\d+):(\d{2}):(\d{2})\.(\d{3})")
def seconds(h, m, s, ms):
return int(h) * 3600 + int(m) * 60 + int(s) + int(ms) / 1000
def check_speed(text, max_cps=20.0, min_duration=1.0):
problems = []
lines = text.splitlines()
for i, line in enumerate(lines):
m = TIME.search(line)
if not m:
continue
start = seconds(*m.groups()[:4])
end = seconds(*m.groups()[4:])
duration = end - start
body = []
for follow in lines[i + 1:]:
if not follow.strip():
break
body.append(follow)
chars = len(" ".join(body))
if duration <= 0:
continue
if duration < min_duration:
problems.append(f"line {i + 1}: cue shorter than {min_duration} s")
if chars / duration > max_cps:
problems.append(f"line {i + 1}: {chars / duration:.1f} characters per second")
return problems
sample = """WEBVTT
00:00:00.000 --> 00:00:03.200
Welcome to the course. Today we build a budget.
00:00:03.200 --> 00:00:03.900
Start by entering your income in column B, not column D.
"""
print(check_speed(sample))Run on the sample, it flags the second cue as shorter than one second and far too fast to read. The thresholds are parameters because they vary by platform and audience.
A script can find cues that are too fast. It cannot find a cue that is early by half a second, because it has no access to the audio. For that, check by ear.
Spot-check for drift
Do not step through a long video cue by cue to find drift. Check at the start, the middle, and the end. If the offset grows from one point to the next, you have drift, and you should find out whether the video was edited after the captions were made. Fixing individual cues will not solve it. If the offset is constant, shift the whole file by that amount. If it grows, regenerate or re-time the captions against the final video.
Step 4: Check against the accessibility requirements
The accessibility chapter listed what makes captions usable. During review, confirm these points against the file:
- Speech is captioned completely, not summarized.
- Speakers are identified when it is not obvious who is talking.
- Meaningful non-speech sounds are described.
- Lines are short enough to read and break at natural phrases.
- Captions do not cover important on-screen content, such as a spreadsheet the speaker is describing.
Where your platform or policy sets a standard, such as a required accuracy level, follow that standard. This chapter does not state one, because it varies by jurisdiction and platform.
Step 5: Test playback in the real player
A file can pass every check and still fail in the player. Load it where learners will see it and confirm:
- The file loads without an error.
- Special characters, such as accented letters or symbols, display correctly. Save the file as UTF-8.
- The captions can be turned on and off.
- Cues display in the right place on both a small and a large screen.
- Timing still matches after any platform processing.
Step 6: Record the review
Write down what you did so the next reviewer can trust it. A short record is enough:
| Field | Example |
|---|---|
| File | `lesson-02.vtt` |
| Draft source | ASR draft, tool name and date |
| Automated checks | Timing and reading speed, clean after 3 fixes |
| Listening pass | Full, at normal speed |
| Changes | 14 text corrections, 2 timing shifts |
| Reviewer and date | Name, date |
| Sign-off | Approved for publishing |
This record feeds the review workflow in the next chapter. It also shows the sign-off was based on a real listening pass.
Common mistakes
- Treating a clean script result as approval. The script checks structure, not truth.
- Reviewing only the transcript. Text can be right while timing is wrong.
- Skipping the term list. Repeated errors on one name appear in dozens of cues.
- Editing after sign-off. If you re-cut the video, the old captions no longer match. Review again.
- Spot-checking only the start. Drift and late errors appear later in the file.
Exercise
A caption file passes your timing script with no problems. The video was trimmed by five seconds at the start after the captions were generated. Is the file ready to publish? What would you check, and how would you fix it?
Show answer
No. The script only checks that cues end after they start and appear in order, so it cannot detect that the captions no longer match the audio. The trim means every cue is probably about five seconds late. Check the start, middle, and end of the video by ear. If the offset is constant, shift every timestamp earlier by five seconds. If it grows over the video, re-time or regenerate the captions against the final cut. Then do the listening pass, play the file in the real player, and record the change.
Exercise
Name two kinds of caption error that a script like check_speed can find and two that only a human listening pass can find.
Show answer
The script can find cues that are shorter than the minimum duration and cues whose characters-per-second rate is too high. A human must find wrong words, such as a dropped "not" or a misspelled product name, and cues that are slightly early or late relative to the speech, because the script has no access to the audio.