How to add MUSIC to your web page
One element of multimedia you can add to your web site is music (or sound).
You can add sound clips or music to your web
page several different ways depending on
your desired effect.
PLEASE ONLY USE IN-LINE SOUND AFTER YOU HAVE ALERTED YOUR USER OF THE EXPECTED
MEDIA....OTHERWISE IT IS CONSIDERED ANNOYING AND CAN POSSIBLY LEAD TO VISITORS ABANDONING
YOUR WEB SITE!
Background Music
Backgound Music plays immediately as
soon as the page is downloaded. Since some
of your users may browse the web late at nite, coming
across a site with
background music suddenly playing can often cause one to quickly hit the mute sound or even
worse, close the browser and avoid visiting your website again. So before creating
this option consider your targeted audience and how your design might be perceived. Remember: Background music can be very annoying.
Use it with extreme caution!
Use MIDI or WAV (midi files are small, WAV files are huge!)
You should only
use this type of sound if the user is expecting it. For example,
on your home page you could create a link that says
Listen to some music. Then when the user clicks the link they are redirected to the page that has the
background music programmed in the code. To accomplish this you will first create
a page with the background music in it then you will add a link from a different
page that links to this new page.
CODE to add BACKGROUND MUSIC to your web page:
<bgsound src="scarymusic.mid" />
OR
<embed scr="christmascheer.midi" />
(NOTE: the <bgsound> tag is only supported with Internet Explorer.)
Be sure to upload the soundfile to your webserver.
Next, creat a link from any other page on your website to go to this page. There
is no sound file attached to this link,
you are simply creating a link to the page
with the sound.
CODE a link to your web page that contains background music:
<a href="~/MUSIC/Example_BackgroundMusic.html"/>
Downloadable Sounds
Before you plan to add downloadable music files to your web site make sure you have permission from the creator of the music pieblece or you own the rights to the music!
CODE to add DOWNLOADABLE MUSIC to your web page:
<a href="men.mp3">Click to hear the song about men</a>
* Be sure to upload the soundfile to your web server.
You might want to add instructions that tells the user how to copy the file to
there computer.
To copy this song
to your computer:
right/click the link and select "save target as".
You can then add a link on any other page of your website that encourages users
to visit your page of downloadable music files. Like this: Get
Music
Sound Effects
Short sound files can be added to your web page that plays after an event happens.
For example, when you mouse rolls over an image or a
button you can have a short sound clip play. Or you can set a sound to play when a user clicks a hyperlink.
You are linking to the sound itself, not necessarily to another web page. Sound effects are more aimed at game
sites.
CODE to add a SHORT SOUND to your web page:
<img dynscr="loadBang.midi" />
Steaming Sound
One of the easiest ways to add sound is to place the sound in a FLASH movie and add volume controls
that lets the user adjust the sound. You need the Flash software application to do this. Using this method
will create a small player with controls.
CODE to SOUND inside of a player:
<object
classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> <param name="FileName"
value="liar.wav" /> </object>
CODE a hyperlink to a SOUND file:
<a href="ilovetexassong.mid"> Click here to play the I love Texas
song. </a>