Will the sound enhance the page, or will it drive people away? Just because the sound file is slightly related to the page topic does NOT mean it should go on your page.
That said, let's take a closer look at sound files and how to set them up on your pages:
A MIDI file (a file that ends with the extension .mid) is essentially a small file with instructions that tell your sound card how to play a song. The better your sound card, the better it will sound. All of the actual playing is done on YOUR computer. You cannot 'record' existing sounds with MIDI.
A WAV file (a file that ends with the extension .wav) is a digital recording of a sound or song. It is much like a cassette tape or cdrom. Because there is so much information contained in .wav's these files tend to be HUGE. (Long .wav's can be anywhere from 500k to 3 MEGS or more!)
<A HREF="bojangle.mid"> Play Mr. Bojangles</A>
Try it here: Play Mr. Bojangles
When a visitor clicks on this link, the file will be downloaded in it's entirety, and then played on their computer using a sound program (like Windows media player) that the user already has. If a user does not have a sound utility/program installed they will hear nothing.
The <EMBED> Tag works in Internet Explorer 4.0x, 5.0x, Navigator 3.0x, 4.0x
The <BGSOUND> Tag works in Internet Explorer 3.0x (best used with the NOEMBED tag... see below)
Here is the coding for adding sound files that most every browser can handle:
<EMBED SRC="example.mid" AUTOSTART="TRUE" LOOP="TRUE" WIDTH="145" HEIGHT="60" ALIGN="CENTER">
<BGSOUND SRC="example.mid" LOOP="10">
Copy and Paste this example into your page and replace the "example.mid" with the name of your sound file.
Using this attribute will tell the browser to play a sound automatically by entering "TRUE" as the Value. The sound will NOT start automatically if you enter "FALSE" as the Value.
LOOP= In Netscape, you can tell the browser to play the sound over and over in an endless Loop by entering "TRUE" as the Value. You can tell the browser to play the sound ONCE by entering "FALSE" as the Value. (Internet Explorer does not recognize this attribute. Use PLAYCOUNT= as shown below for IE.)
Entering a number ("2" or "5" etc.) will tell Internet Explorer how many times to play the sound. (Netscape does not recognize this attribute.)
WIDTH= and HEIGHT=
In Netscape, these attributes define the appearance and size of the CONTROL PANEL it creates. (Internet Explorer does not recognize this Tag.)
The smallest Value you should use for these two attributes is:
If you put anything smaller or do not include these two attributes you may encounter trouble getting the control panel to appear properly.
For Internet Explorer, enter "TRUE" as the Value to show a CONTROL PANEL and enter "FALSE" to not show it.
Tells the Browser where to display the CONTROL PANEL. Enter "right", "left", "absmiddle", "top" or "bottom" as your Value.