The anchor tag <a> can be used to hypertext to sounds. The syntax of the link command used to incorporate a hypersound link into a document is identical to that of any other form of link; that is:

<a href=SoundURL>Text describing .wav file.</a>

When a hypersound link is taken, the sound is fetched and played using the sound playback mechanism associated with the browser. Of course, a sound card must be installed to hear anything (and the volume must be a non-zero value). The following table contains some sounds that are commonly used operating system sounds.

applause.wav camera.wav carbrake.wav cashreg.wav
chimes.wav clap.wav drumroll.wav explode.wav
glass.wav gunshot.wav laser.wav reminder.wav
projctor.wav ricochet.wav type.wav whoosh.wav

Exercise 10

Write a HTML document that:


If the .wav files are locally available (say on CD) then you should copy them to the same drive as the drive containing your htmlsamp directory. On the HTML Guide and Reference CD, the wav files are contained in the root directory named wav. Once copied to a sibling directory of the htmlsamp directory, the form of the links is filename.wav.


Take this link to see the solution of the exercise. You should view the source of the solution and compare it to that which you provided. You should add the solution of this exercise to the samples panel that you created in exercise 6.

Embedding Sounds

A sound or movie may be embedded in a document using the tag <embed>. Browsers differ in their support and parameters for this tag. To embed a sound the following syntax may be used.

<embed src=filename.wav width=130 height=50 playcount=2>

A live example is shown below.

That's it for sound, the next chapter next.gif shows how to incorporate images in documents.