Ensure <audio> elements have captions
Rule ID: audio-caption
User Impact: critical
Guidelines: Deprecated
The <audio>
element must include a
<track>
element with
kind="captions"
to provide synchronized text
alternatives for deaf or hard-of-hearing users.
What is being tested?
This rule checks that every <audio>
element includes at least one <track>
element with the kind="captions"
attribute.
Captions must include dialogue, speaker identification, sound effects, and musical cues.
Why it matters
Without captions, deaf or hard-of-hearing users miss critical audio content, including dialogue, speaker identification, and important sounds. Captions make audio content accessible and allow all users to fully understand the material.
How to fix the problem
- Add a
<track>
element inside<audio>
withkind="captions"
. - Ensure the captions file includes all meaningful audio information (dialogue, sound effects, speaker IDs).
- Use correct language codes with
srclang
and a clearlabel
.
Example code
<audio> <source src="mySpeech.mp3" type="audio/mp3"> <track src="captions_en.vtt" kind="captions" srclang="en" label="English captions"> <track src="captions_es.vtt" kind="captions" srclang="es" label="Spanish captions"> </audio>
Important notes
- Captions are not the same as subtitles—captions include non-speech information like music and sound effects, while subtitles are usually just translations.
-
Use
kind="captions"
(notkind="subtitles"
) to support deaf access.
Best practices
- Provide captions in all supported languages where possible.
- Ensure captions are accurate, synchronized, and cover all meaningful sounds.
- Test captions on multiple devices and browsers to confirm they display properly.
Other Rules
Interested in other web accessibility rules? Please see these other rules: