Before we get started with the HTML5 audio element, we need to configure our server for allowing specific audio formats to play appropriately. First, let's take a moment to understand the appropriate audio formats.
Support for the HTML5 audio playback is similar to that of the video element, in that each browser supports different types of formats for one reason or another. Here are some tables showcasing what is supported:
Following are the details related to desktop browsers:
Desktop browser
Version
Codec support
Internet Explorer
9.0+
MP3, AAC
Google Chrome
6.0+
Ogg Vorbis, MP3, WAV
Mozilla Firefox
3.6+
Ogg Vorbis, WAV
Safari
5.0+
MP3, AAC, WAV
Opera
10.0+
Ogg Vorbis, WAV
Following are the details related to mobile browsers:
Mobile browser
Version
Codec support
Opera Mobile
11.0+
Device-dependent
Android
2.3+
Device-dependent
Mobile Safari (iPhone, iPad, iPod Touch)
iOS 3.0+
MPEG, MPG, MP3, SWA, AAC, WAV, BWF, MP4, AIFF, AIF...