Search billions of records on Ancestry.com
   

I'm not terribly fond of music on a web page, particularly the music that starts playing as soon as the page is loaded and which you can't turn off except by leaving the page (or grabbing for your speaker switch). Besides, I might just be listening to a CD on my computer and the speakers are already occupied.

However, it is reasonable to offer music to your visitor and allow them to turn it on or off at will. To do this, you need to code your multimedia tags either as a standard link or so that a console is available.

In the past, Microsoft Internet Explorer and Netscape Navigator have used their own, incompatible, methods of coding the tags to play your music files. Now, both IE and Navigator support the non-standard <EMBED> tag along with the HTML 4.0 standard <OBJECT> tag.

A sound console for the visitor

The simplest way to put a console on your page with a music file attached is use the EMBED tag and specify width and height dimensions large enough to display the entire console.

<embed src="bark.wav" width="147" height="70">

It turns out that the console that your visitor sees will depend on how his browser is configured and which multi-media application happens to be associated with the sound file type that you are using. Netscape Navigator supplies its own built in console, Internet Explorer might use the Windows Media Player or an Active-X control. If you have RealPlayer or WinAmp installed, you may see the console supplied by one of these programs. The optimum size for these consoles varies, but I've found that 60-70 pixel high and 147 pixels wide is sufficient for any of the players I've run across.

 

Images of various sound consoles
Windows Media Player Netscape Navigator RealOne

Note that there may be different behavior with the browsers and the "plug-in" that is used to play the sound file. Navigator's internal player waits until you press the "play" button before you hear the sound. Internet Explorer with the Microsoft Media Player will play the sound file once as soon as it is loaded. If you want to assure the same behavior on both browsers, add the autostart= parameter and specify false if you want no sound until the play button is pressed or true if you want the sound/music to play automatically. So now, your <EMBED> tag looks like this:

<embed src="bark.wav" width="147" height="70" autostart="false">

Linking to a sound file

You can code a link to a sound/music file in your page just like you code links to web pages or to image files. When clicked, the browser will open a separate window which will play the sound. Navigator uses the same built-in player/console as we saw in the <EMBED> discussion. Internet Explorer will open the application which is registered for the particular file/media type. In many cases, this is the Microsoft Media Player, but may be another application (WinAmp, RealPlayer, etc.) if it's installed.

The link is coded like this:
<a href="bark.wav">Dog barking</a>

Dog barking