HTML Audio
Write an audio element for interview.mp3 and include a visible transcript link.
Understand the topic
The audio element supplies browser playback controls for a sound resource. Multiple source elements can offer compatible formats. Spoken recordings need a transcript so the information remains available without hearing or playback. Duration, network speed, and encoding affect the experience. Give users control rather than starting sound unexpectedly.
Worked example
<audio controls preload="none">
<source src="welcome.ogg" type="audio/ogg">
<source src="welcome.mp3" type="audio/mpeg">
<p><a href="welcome.mp3">Download the welcome recording</a></p>
</audio>
<p>Transcript: Welcome to our beginner HTML workshop.</p>
The browser chooses a source it can play. Supply real recordings before using the markup; the transcript should reflect the actual spoken content.
Practice
Write an audio element for interview.mp3 and include a visible transcript link.
Show a suggested answer
<audio controls src="interview.mp3" preload="none"></audio>
<a href="interview-transcript.html">Interview transcript</a>Common mistake
Do not use an audio file to carry essential information without an equivalent text alternative.