HTML and CSS Reference
Although sound is not appropriate for every website, it's definitely an online option — and
essential to certain types of sites. Just as with images and video, there is a vast range of formats
for audio, but only a few are widely used. In this lesson, you learn which formats are the most
compatible with the Web, the simplest approach to bringing music to a site, how to integrate an
audio plug-in, and how to play audio natively with HTML5.
MP aa ibLe audio
To play an audio file on the Web, the sound must be recorded in a digital format. Uncompressed
audio formats, such as the Audio Interchange File Format (AIFF) developed by Apple or
Waveform Audio File Format (WAV) created by Microsoft and IBM, were popular in the
early history of the Web. Although still seen on some websites, most web designers have
switched to faster-loading, compressed audio formats like MP3.
The MP3 — short for MPEG Audio Layer 3 — format features high-quality digital audio files
with excellent compression. MP3 has become the standard for downloadable music. Like all
formats prior to HTML5, MP3 requires a plug-in, but support is widespread. MP3 files can
be played in the QuickTime Player, RealPlayer, Windows Media Player, and a whole range of
standalone players that work as browser helper applications. Basic MP3 files must be com-
pletely downloaded before they begin to play.
Another approach is streaming audio, which plays as it downloads. RealAudio, developed by
RealNetworks, is an example of a streaming audio. Playback of a RealAudio file — which can
be recognized by a .ra or .ram file extension
.ram — requires the use of the RealPlayer plug-in.
.ram file extension
One of the most recent entries into the audio format arena carries the somewhat odd name of
Ogg Vorbis, also known as just Vorbis. Vorbis files, which use an .ogg file extension, are simi-
lar in quality to MP3, but are also streamable. The format was developed by an open source