HTML: audio

The <audio> element embeds sound and can provide native playback controls.

What you will learn

Minimal example

<audio controls>
  <source src="podcast.mp3" type="audio/mpeg">
  Your browser does not support audio playback.
</audio>

The controls attribute lets users play, pause, seek, and change the volume. The text inside the element is a fallback for unsupported browsers.

Provide a transcript

For spoken content, provide a text transcript near the player. A transcript helps people who cannot hear the audio and users who need to search or read quietly.

Autoplay and accessibility

Do not start sound unexpectedly. Autoplay can be disruptive and browsers may block it. Let users choose when playback begins and provide a clear pause control.

Common mistakes