Home / Learn HTML / HTML Audio
HTML Audio
The audio element plays sound. It works like video but has no picture.
Definition
The audio element plays sound: music, a podcast, a voice recording. Formats are MP3, WAV and Ogg. It works just like video: add controls and give one or more source files.
Theory in plain words
What it is
The audio element plays sound files with a built-in player.
Why we use it
It lets you add podcasts, music and sound effects without extra software.
How it works
The browser shows a small player when controls is set and plays the first supported source.
Where it is used
- Podcasts
- Pronunciation in language lessons
- Sound effects
Saves data until the person presses play.
Quick quiz
1. Which tag plays sound?
audio plays sound.
2. Which makes sound repeat?
loop repeats forever.
3. Which attribute delays loading?
Saves data until play.
Common questions
Which tag plays sound?
<audio>. audio plays sound.
Which makes sound repeat?
loop. loop repeats forever.
Which attribute delays loading?
preload="none". Saves data until play.