The HTML5 audio element

This is an example file for an HTML5 Audio and Video tutorial:HTML5 audio and video

Look at the source if you don't want to read the EduTechWiki article ...

1. Most simple use

In this section we first will display different audio formats. That way you can test your browser. We finally show how to define alternatives.

ogg

This example wouldn't work in a browser like IE9 that doesn't support Ogg

mp3 (MPEG-2 audio)

This example wouldn't work in a browser like Firefox that doesn't support mp3

m4a (MPEG-4 Part 14 audio / AAC)

This example wouldn't work in a browser like Firefox that doesn't support m4a

wav (PCM)

2. Defining alternatives

This example should work in most current modern web browsers, since it defines the three most popular alternatives. However, defining a container format may not be enough, since each container may include different codecs. I.e. there are '''many''' codecs, in particular of WAV/PCM


W3C validator