Although the Web is primarily a visual medium, as it has matured, the use of audio has become much more common. Proper use of audio can serve many purposes on an educational site—to set a mood, provide an alternate communication channel apart from the visual material, or give an audible clue for different actions within the inter- face, for example. As with other multimedia, the important thing to remember is to use audio for a specific purpose and not to overdo it.
File Formats
There are two main categories of sound on the Web today: self-contained (have to be downloaded to the local computer before they can be heard) and streaming audio. The
following subsections explore the first category of audio file types. Streaming audio is examined within the presentation of streaming media later in the chapter.
AU (.au) The first audio file format used on the Internet, Audio File Format was intended for use on UNIX computers. It is also the standard sound format for the Java platform. This format supports a 2:1 compression ratio, which gives the format a rel- atively small file size of about 8 KB per second of audio. It is probably the closest to a nonproprietary audio standard available on the Internet and so can be found in quan- tity from sound libraries. Because the quality of AU files is not high, they work well for short clips and sound effects but would not be the first choice for a project that relies heavily on sound.
AIFF (.aiff, .aif) Apple developed the Audio Interchange File Format for the Mac- intosh platform. The AIFF format is uncompressed, so the files can be large. Its sound quality is better than the AU format.
WAV (.wav) Developed by Microsoft, the Waveform Audio File Format is the PC/
Windows equivalent of Apple’s AIFF. Because it is the native sound file format for the platform that has the overwhelming majority of presence on the Internet, it is com- mon to see. However, it, too, is an uncompressed format, and just sixty seconds of WAV audio can take up more than 10 MB of disk space. WAV has a comparable sound quality to AIFF. Because it is uncompressed, WAV is the preferred format for saving archival versions of audio.
All three store recorded sound that originated as analog and was converted to dig- ital. The next file type is quite different.
MIDI (.midi, .mid) The Musical Instrument Digital Interface is a protocol adopted by the electronic music industry for controlling music synthesizer devices (both key- boards and sound cards). It doesn’t represent music sounds directly (as is the case with AU, AIFF, and WAV), but instead transfers information that tells the synthesizer what to play to produce a musical composition. MIDI might thus be compared with vector graphics in that both file types consist of instructions or commands. Like a vector file, the MIDI file sizes are smaller than their counterparts because the instructions con- sume much less data. One drawback to the MIDI format is that it plays only instru- mentals, not voices.
MPEG Both an audio and a video compression format, MPEG is also the acronym for Motion Pictures Experts Group, and is explained in full in the video section of this chapter.
MP3 (.mp3) MPEG-1 Audio Layer-3 is the most popular audio format on the Web today. Although it is most famous for the illegalities involved with downloading files, MP3 is in fact just an efficient audio compression format. The compression ratio is 12:1, yet the sound quality is preserved. Although it has often been assumed to be an open (nonproprietary) standard, this isn’t the case. Fraunhofer Institute was the main developer of the MP3 standard and joined forces with Thomson Multimedia to put together a patent portfolio and ask for royalties for developers to use it.5
Ogg Vorbis (.ogg) This led to the development of a completely open and free audio compression, Vorbis, from the Xiph.Org Foundation. The code for the latest release is available from the Vorbis Web site (http://www.vorbis.com). It is frequently used in
conjunction with Ogg container, a fully open multimedia bitstream format designed for efficient streaming and storage. When used together, it is known as Ogg Vorbis.
Ogg Vorbis has become popular with the open source communities, but MP3 technol- ogy is extremely entrenched in the public eye. However, an increasing number of audio players, including WinAmp for PCs (http://winamp.com) and WHAMB.com for Macs (http://www.whamb.com), support Ogg Vorbis in their products, so its use will surely increase over time as developers are required to pay royalties for MP3.
Windows Media Audio (.wma, .asf) This Microsoft audio format is proprietary and compressed, designed initially as a competitor to MP3. It has now positioned itself as a competitor to the Advanced Audio Coding format used by Apple for iTunes. The initial reason for the development of WMA most likely was related to the patent issue with MP3, which had to be licensed to be included with the Windows operating sys- tem (OS). A WMA file is often encapsulated in an Advanced Systems Format (ASF) file. This format specifies how the metadata for the file is to be encoded. Advantages claimed over MP3 include being better suited to low bitrates (especially around 8–64 kbit/sec) and producing better quality at a given bitrate than MP3. To play WMA files, you can use the Windows Media Player or other players such as Winamp. It also has a digital rights component that protects against the unauthorized reproduction of copyrighted material.
File Download versus Inline
Linking to a sound file is the simplest way to include sound in a Web page. This method is the most appropriate when supplying certain types of files such as sound clips that accompany other material. Providing a link puts the control of the sound into the user’s hands. When using a link, remember to include all the information about the file that is important to the audience: type of file format, file size, and esti- mated download time. A typical link might look like this:
<a href=“boolean.wav”>Hear about Boolean Logic</a>
When the user clicks on this link, either a player or a plug-in will be invoked, depend- ing on the browser and its configuration.
Sounds may also be embedded, that is, be put in line so that they are a part of your page resulting in sound playing automatically in the background when the page loads.
Since HTML version 4.01, the <object> tag embeds media in a Web page. The older
<embed> and <bgsound> tags were never sanctioned and should not be used. You will find that there is only spotty support for embedded sounds from browser to browser, so be prepared to test in different browsers and across platforms to ensure that the sound works as you intend.
A third option for including sound files is JavaScript, whether having sound play when the screen loads or in response to different mouse actions.
If you decide to include background sound, do your audience a favor and give them the controls to turn the music on and off. What sounds great to one person may sound like fingernails across the blackboard to others.
Using Existing Sound Files
If you don’t have the experience or expertise to create your own audio files, you’ll probably want to access the many sound libraries that are available on the Web for
clips. However, be careful when downloading others’ sound files and always research the copyright requirements. Copyright issues in the music industry are complicated and rather a hot topic now. Several organizations deal with various aspects of music copyright, including the ASCAP (American Society of Composers, Authors and Publishers, http://www.ascap.com), BMI (Broadcast Music, Inc., http://www.bmi .com), RIAA (Recording Industry Association of America, http://www.riaa.com), and the HFA (Harry Fox Agency, Inc., http://www.nmpa.org/hfa.html).