HTML and CSS Reference
Audio Formats under HTML5
The MP3 format is one of three file formats currently supported by the browsers that
support HTML5. The other two formats are the WAV format and Ogg Vorbis. Figure 7-5
describes each of these formats.
audio formats in HtMl5
The most popular format for downloading and storing music, MP3 compresses
sound files to roughly one-tenth the size of uncompressed files while maintaining
good audio quality. However, the MP3 format is proprietary and not royalty-free,
which can be a hindrance to audio distributors.
A file compression format designed for Web audio, Ogg Vorbis is an open source
and royalty-free format. In general, Ogg Vorbis provides better sound quality than
MP3, especially at lower bitrates. However, few portable players support Ogg
Vorbis, while the MP3 format has almost universal support.
The original audio format for Windows PCs, WAV is commonly used for storing
uncompressed CD-quality sound. In this format, a WAV file requires about
10 megabytes per minute of sound, making it impractical as a format for Web
audio for all but the shortest audio clips.
A great deal of controversy has surrounded the selection of a common audio for-
mat for HTML5. The original HTML5 specifications in January 2007 explicitly called
on browsers to support the Ogg Vorbis format because it is royalty-free and thus
would allow for the quick development and publishing of audio products for the Web.
However, not all browser vendors went along with this proposal; Apple in particular
refused to implement Ogg Vorbis in its Safari browser, citing the lack of support for that
format on portable media players and its doubts about its sound quality. Microsoft also
declined to support Ogg Vorbis. These events led to a revision of the HTML5 audio
specification, changing the proposal to a general guideline for a common audio format
without supporting one format over another. All of this leaves Web developers stuck
amid the three audio formats, none of which are supported by every browser. Figure 7-6
describes the support among the major browsers for MP3, Ogg Vorbis, and WAV at the
time of this writing.
audio formats supported by HtMl5 audio