SpydarGrafix³ LogoAdding Sounds

         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

<BODY></BODY> tag.



         Let us start with a link to play a sound. This is what your coding would be.

<A HREF="music.mid">Click here to play music!</A>

Note: The name of the mid is not "music.mid", make sure you use the correct filename for the sound you want to use on your page.

          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.

<A HREF="music.mid"><IMG SRC="graphic.gif" ALT="sound graphic"> </A>

sound graphic   Now, click on the graphic to hear the sound play again.
Hehe, now we are having some fun!!


         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.

<BGSOUND="music.mid" LOOP=1>

         LOOP assigns the number of times the background sound will play. Assigning LOOP=INFINITE will make the sound play over and over again, until your viewer clicks out of the page you assigned the sound to.

         Use this next tag, for people who use Netscape.

<EMBED SRC="music.mid" HEIGHT=60 WIDTH=144 AUTOSTART=[true/false] LOOP=[true/false] HIDDEN=[true/false]></EMBED>

HEIGHT=60 WIDTH=144 defines the height and width of the sound control panel, unless you use HIDDEN=TRUE.

The contol panel would look like this:


Or use, HEIGHT=15 WIDTH=51 CONTOLS=smallconsole for a smaller control panel, which won't take so much room on your page.
The contol panel would look like this:

         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.

[Back to the TOP]

[ Back to Tutorial List ] - [ Next Lesson ]

[ Home Page | HTML Bookstore | Free Web Graphics | Our Friend's Pages ]

[ E-Mail Us ]


This page hosted by Get your own Free Home Page


This Site Created By JPWeb Consulting
©1996-2004 - All Rights Reserved
1