In this lesson you will learn to add sounds to your pages. Sometimes, they can be a soothing asset, sometimes they can be a nuisance, so pick the sound files that you want to use with caution in mind. Most Web Browsers accept .MID, .WAV and .AU formats for sounds.
You can set up your page to play either background music, or only play when a viewer of your page clicks on the sound link. It isn't difficult, so let's get started!
Whichever way you want your sounds to work, remember that the tags go within the
Let us start with a link to play a sound. This is what your coding would be.
Now click and hear the sound start to play. Click here to play music! Kewl huh?!?
Let's say you want to put a graphic with that sound, so that when your viewer clicks on the graphic the sound plays. Pick a graphic you may want to use, and, as you learned in the graphic lesson, we will identify it. Here is the code for the sound/graphic.
Now, for some browser sensitive commands. Because of this, you may want to use both codes with your pages, so people can hear them in Microsoft Internet Explorer, Web TV and Netscape. First we will do the Microsoft Internet Explorer and Web TV commands.
Keep in mind, these tags go AFTER the <BODY> tag and BEFORE the </BODY> tag.
Use this next tag, for people who use Netscape.
HEIGHT=60 WIDTH=144 defines the height and width of the sound control panel, unless you use HIDDEN=TRUE.
It is our recommendation that you use HIDDEN=FALSE on your web page, that way, the sound control panel will show, and viewers will be able to turn the sound off if they do not want to hear it.
AUTOSTART=TRUE if you want your sound to play when the page is up loaded. Use AUTOSTART=FALSE or just omit the AUTOSTART command if you don't want the sound to start automatically.
HIDDEN=TRUE if you do not want the sound control panel to show on your page.
HIDDEN=FALSE if you want to show the sound control panel. Which is what we strongly recommend.
So that about sums up the use of sounds on your web pages! Not too difficult, huh?
Remember that these tags are browser sensitive, so to permit your viewers to hear the sound you choose use both commands when coding your page. Here is an example of how is should look:
<BGSOUND SRC="music.mid" LOOP=1>
<EMBED SRC="music.mid" HEIGHT=60 WIDTH=144 AUTOSTART=TRUE LOOP=TRUE HIDDEN=FALSE>
Note: Make sure, when you upload your files to the server you will be storing them on, that you upload the sound file you will be using. It must be in the server directory for your web page to find it and play it.
[ E-Mail Us ]