HTML and CSS Reference
WAV Audio Format
One of the older and more familiar audio file formats is the Waveform Audio File Format
(WAVE), commonly known as WAV for the extension the audio files are given (.wav). Though
WAV files can support compression, most WAV files contain audio in an uncompressed Pulse-
Code Modulation (PCM) representation, which means the files tend to be quite large.
Safari, Chrome, Firefox, and Opera support uncompressed WAV files. However, the size of
the WAV files preclude their being a popular HTML5 audio file format.
Another well known and common audio file format is the MPEG-1 Audio Layer 3, commonly
known as MP3 because of the extension given MP3 files (.mp3). It is neither a container or
codec, as we know these things. Instead, it's an all-in-one lossy compressed audio file with
metadata strategically inserted.
At this time, the only audio format that Microsoft supports in IE9 and up, by default, is MP3.
In addition, the format is also supported by Safari and Chrome. However, Firefox and Opera
refused to support MP3s right from the start, because of patent issues and royalty require-
MP3 is supported in most operating system environments, and MP3 files are a popular fall-
back when linked into the page. Though the file won't play natively in the browser, clicking
the link will trigger some media player in most environments:
<audio id="background" autoplay loop>
<source src="audiofile.mp3" type="audio/mpeg" />
<source src="audiofile.ogg" type="audio/ogg" />
<p><a href="audiofile.mp3">Your audio file fallback</a></p>
Safari requires the installation of QuickTime and supports whatever media types QuickTime natively
supports in the system. Since QuickTime supports MP3 and WAV, Safari supports MP3 and WAV.
When the media elements were first added to HTML5, the specification included a require-
ment that all user agents support the Ogg open source container. The Ogg container was de-
veloped by the Xiph.Org foundation, which also developed an associated audio codec, called
Vorbis. The Vorbis codec is a lossy compression technique that is free for everyone to use and
is, according to the folks at Xiph.Org, free of patents (to the best of their determination). The