The 3-Part Audio Element

If you have your own audio files, the audio element allows you to add a functioning player to your website.

The 3 attributes the audio element should include are:

  1. The tags themselves.
  2. The source attribute.
  3. Other attributes which define how users can interact with the media.

Note As there are two ways to approach this, the following pages with showcase both:

Single-Source

Use this set-up if you only have one version of the audio file, like an MP3.

mp3 icon

song.mp3

Multiple-Source

Use this set-up if you have multiple versions of the audio file, like MP3, WAV, OGG, etc.

mp3 icon

song.mp3

wav icon

song.wav

ogg icon

song.ogg