Share this Page URL

Chapter 11. Making Your Web Pages Dance ... > Sound Advice: Adding Sounds to Your ... - Pg. 121

Making Your Web Pages Dance and Sing 121 · MP3--This is an incredibly popular format for digital music. The latest versions of Internet Ex- plorer and Netscape use the Windows Media Player as the helper application for playing MP3 files. You can also get MP3 players from the site ( · RA--This is the RealAudio format, which is used to "stream" large audio files. This means that you don't wait for the entire file to download. Instead, the browser grabs the first part of the file and starts playing it while the rest of the file downloads in the background. · MIDI--This is the Musical Instrument Digital Interface format, and it's used to represent elec- tronic music created with a MIDI synthesizer. This format is supported by Internet Explorer and Netscape Navigator 4.0 (for Navigator 3.0, you need the appropriate helper application set up). I provide a list of some sites that serve sound files in Chapter 22, "Some HTML Resources on the Web." Sounding Off with Sound Links After you have your mitts on a sound file, adding the sound to your web page is a no-brainer. All you have to do is copy the file to your website and then set up a link that points to that file, like so: <A HREF="burp.wav">Click here for a special greeting!</A> Assuming the viewer's browser is set up to handle the sound format you're using, the sound file downloads and then plays without further fuss. Embedding Sound Files If you want to add MIDI music or other sounds files to your pages, one way to go is the <EMBED> tag, which is supported by both Netscape Navigator and Internet Explorer. At its simplest, you use the SRC attribute to specify the name of the sound file, like so: <EMBED SRC="playme.mid"> Here's an example page (see midi.htm on this book's CD), and Figure 11.1 shows the Internet Explorer interpretation. <HTML> <HEAD> <TITLE>A MIDI Example</TITLE> </HEAD> <BODY> Click the Play button to hear some cool jazz music:<BR> <EMBED SRC="jazz.mid"> </BODY> </HTML>