Including Sound in a Web Page
January 4, 1999
Inserting an audio or MIDI file into a Web page is a piece of cake.
Just link to it. For example:
<A HREF= "bark.wav">
Usually, when you click on such a link, the browser's internal
little audio appsky will pop up and play the sound. Explorer
supports .wav, .au, .aiff and .mid files, while Netscape supports
.wav and .mid. Try it by clicking on these links:
Dog Bark in .wav Format
Dog Bark in .au Format
Much more control over playback is offered by the EMBED tag.
EMBED takes various attributes that allow you to control the
appearance of the onscreen player, or hide it altogether. You
can also set the sound to play automatically when the page is
loaded. For example:
<EMBED SRC="BARK.WAV" HEIGHT="40" WIDTH="200">
will cause a 40x200 player to appear at the desired point in the
page, which will play a wave file called "bark."
<EMBED SRC="BARK.WAV" HIDDEN="TRUE" AUTOSTART="TRUE">
will cause the file to play when the page loads, and no onscreen
console will appear. Another way to do the same thing, but which
only works in Explorer, is to use a BGSOUND
tag right after the BODY tag, for example:
<bgsound src="bark.wav" loop=5>
|