Skip to content

Latest commit

 

History

History
executable file
·
200 lines (148 loc) · 6.33 KB

audio-transcript-2eb176.md

File metadata and controls

executable file
·
200 lines (148 loc) · 6.33 KB
id name rule_type description accessibility_requirements input_aspects acknowledgments
2eb176
`audio` element content has transcript
atomic
This rule checks that `audio` elements have a transcript that includes all auditory information.
DOM Tree
CSS Styling
Audio output
Language
authors funding assets
Brian Bors
Wilco Fiers
WAI-Tools
JFK's "We Choose the Moon" speech excerpt is courtesy of NASA.

Applicability

This rule applies to every non-streaming audio element that is:

Note: A play button is an interactive element that when activated, plays the audio.

Expectation

The auditory information of each test target is available through a text transcript. That text transcript is visible and included in the accessibility tree, either on the page or through a link.

Note: A "text transcript" in the context of this rule is defined in WCAG 2 as an alternative for time based media.

Assumptions

This rule assumes that the language of each test target can be correctly determined (either programmatically or by analyzing the content), and sufficiently understood.

Accessibility Support

There are no major accessibility support issues known for this rule.

Background

Bibliography

Test Cases

Passed

Passed Example 1

This audio element has native player controls and an internal transcript.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" controls></audio>
	<p>
		The above audio contains the following speech: We choose to go to the moon in this decade and do the other things,
		not because they are easy, but because they are hard, because that goal will serve to organize and measure the best
		of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to
		postpone, and one which we intend to win, and the others, too.
	</p>
</html>

Passed Example 2

This audio element has native player controls and an external transcript.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" controls></audio>
	<a href="/test-assets/moon-audio/moon-speech-transcript.txt">Transcript</a>
</html>

Passed Example 3

This audio element has an autoplay attribute and an external transcript.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" autoplay></audio>
	<a href="/test-assets/moon-audio/moon-speech-transcript.txt">Transcript</a>
</html>

Failed

Failed Example 1

This audio element has native player controls and no transcript.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" controls></audio>
</html>

Failed Example 2

This audio element has native player controls and an incorrect internal transcript.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" controls></audio>
	<p>
		The above audio contains the following speech: We choose to go to the cheese in this decade and do the other things,
		not because they are easy, but because they are hard, because that goal will serve to organize and measure the best
		of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to
		postpone, and one which we intend to win, and the others, too.
	</p>
</html>

Failed Example 3

This audio element has native player controls and an incorrect external transcript.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" controls></audio>
	<a href="/test-assets/moon-audio/moon-speech-incorrect-transcript.txt">Transcript</a>
</html>

Failed Example 4

This audio element has an autoplay attribute and an incorrect external transcript.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" autoplay></audio>
	<a href="/test-assets/moon-audio/moon-speech-incorrect-transcript.txt">Transcript</a>
</html>

Failed Example 5

This audio element has native player controls and a non-visible internal transcript.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" controls></audio>
	<p style="text-indent: -9999px;">
		The above audio contains the following speech: We choose to go to the moon in this decade and do the other things,
		not because they are easy, but because they are hard, because that goal will serve to organize and measure the best
		of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to
		postpone, and one which we intend to win, and the others, too.
	</p>
</html>

Failed Example 6

This audio element has native player controls and an internal transcript that is not exposed to the accessibility tree.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" controls></audio>
	<p aria-hidden="true">
		The above audio contains the following speech: We choose to go to the moon in this decade and do the other things,
		not because they are easy, but because they are hard, because that goal will serve to organize and measure the best
		of our energies and skills, because that challenge is one that we are willing to accept, one we are unwilling to
		postpone, and one which we intend to win, and the others, too.
	</p>
</html>

Inapplicable

Inapplicable Example 1

This audio element has no native player controls.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3"></audio>
</html>

Inapplicable Example 2

This audio element has hidden native player controls.

<html lang="en">
	<audio src="/test-assets/moon-audio/moon-speech.mp3" controls style="display: none;"></audio>
</html>