Please note, I only know how this works under Netscape, I don't know if this works at all under Internet Explorer.
When adding sound to your webpage there are two things that you must keep in mind, file size and the irritant factor. No one wants to wait 5 minutes for a background sound (one that loads up as your page does). And when a person clicks on a link to load a file its nice to put a little note as to how big that file is so they know what they are getting into. As a rule midis are smaller than .aus and .wavs and have the added bonus of being able to work just about any system. As to the irrirant factor, you know what annoys you, keep it in mind when your putting sound on your page. Remeber its not nice to put really annoying .wavs, .midis, and .aus on a constant loop without giving an option to turn it off.
Most of what I'm going to describe here will only work under Netscape 3.0 and up. You can link to a sound under Netscape 2.0 but not define one as a background sound as far as I know. To link to a sound you first need a sound to link to.
Use this Sound If your using a PC right click on this link to save the file, if your using a Mac just hold down the mouse button.
Now let's make a simple webpage with a link to this sound:
<HTML>
<BODY>
<A HREF="tuxedo.mid">Click here to hear a noise.</A>
<BODY>
</HTML>
This should work under any browser above 2.0.
You can also embed a sound in your webpage. This is a sound that will load, but not necessarily play, when your webpage loads. Lets make a page with an embeded sound.
<HTML>
<BODY>
<EMBED SRC="tuxedo.mid" WIDTH=150 HEIGHT=100>
<BODY>
</HTML>
This loads it up but it won't play until the user hits the play button. Click here to see how this would work. View it.
You can modify this so that when the user hits play the sound will keep playing until they click on the stop button by adding the "LOOP" variable into the tag. If all you say is LOOP = TRUE the sound will loop for as long as the page is being viewed. You can also set the number of loops by giving the varaiable a number such as LOOP = 5. The number can be any integer. Here is what the page would look like then:
<HTML>
<BODY>
<EMBED SRC="tuxedo.mid" WIDTH=150 HEIGHT=100 LOOP = TRUE>
<BODY>
</HTML>
Click here to see how this would work. View it. (see what I mean about annoying noises?)
You can also modify it so that the sound will load and play when the page loads up by additn the "AUTOSTART" variable into the tage. Here is what the page would look like then:
<HTML>
<BODY>
<EMBED SRC="tuxedo.mid" WIDTH=150 HEIGHT=100 LOOP = TRUE AUTOSTART
= TRUE>
<BODY>
</HTML>
Click here to see how this would work. View it.
You can change what the console that controls the sound looks like by adding in the "CONSOLE" variable. There are several different variations to choose from , here's some of the most common (I've taken out the LOOP and AUTOSTART variables out of convience. You can use both variables them together:
<HTML>
<BODY>
<EMBED SRC="tuxedo.mid" WIDTH=150 HEIGHT=100
CONSOLE=SMALLCONSOLE>
<EMBED SRC="tuxedo.mid" WIDTH=150 HEIGHT=100 CONSOLE
=PLAYBUTTON>
<BODY>
</HTML>
Click here to see how this would work. View it.
These two need the AUTOSTART variable to work.
<EMBED SRC="tuxedo.mid" WIDTH=150 HEIGHT=100 AUTOSTART=TRUE CONTROLS=STOPBUTTON>
Click here to see how this would work. View it.
<EMBED SRC="tuxedo.mid" WIDTH=150 HEIGHT=100 AUTOSTART=TRUE CONTROLS=PAUSEBUTTON>
Click here to see how this would work. View it.
You can also hide the console completely by adding HIDDEN=TRUE to the tag. I don't recommend doing this however because it prevents the user from turning off the sound if he or she wishes. I'm trying to find out what the HTML is for adding sound so that Internet Explorer can read it, as soon as I find out I will add it to this page.