Search Helium

Home > Computers & Technology > Internet > Web Design

How to place background music in a web page

by Tim StS

Created on: April 09, 2008

Adding background music to your web page can be done in a few simple steps.

Before I go over those steps though, you need to ask yourself if you REALLY want background music on your page. Background music, by definition, is in the background. It cannot be controlled. Which means you are forcing it on everybody that is kind enough to stop by your site. And people don't like having things forces on them.

Imagine going to work and hearing a loud song right as you walked in. Then imagine hearing that same loud obnoxious song EVERY TIME you got to work. Day after day after day. It would get pretty old, right?

So for the most part I would suggest against using a background sound. Other options would be an embedded sound (one that the user can control on the web page) or linking to a sound (which can work a few different ways but at least you are giving your user the choice). Either of these options are better than background music. Really.

Still here? Alright, you cannot be swayed. Don't say I didn't warn you! Here is the very quick and easy 2 step guide to adding background sound or music to your web page.

*1* Between the BODY tags, create a new tag like this: BGSOUND SRC="sound.ext" where sound is the name of your audio file and .ext is the type of extension. You may have to transfer your audio file to an accepted version. I prefer using .wav files on my pages. Midi files also add a little flare.

*2* That is it actually. Make sure your audio file is saved in the same folder as your HTML file and you should hear beautiful music every time you load your page.

*OPTIONS* Here is where you can really drive your page visitors insane! Within the BGSOUND tag, type LOOP=x where x is the number of times you want your sound to play. If you type -1 there, the song will be played over. and over. and over. This is a great way to ensure no one ever comes back to your site again. If you don't add the LOOP tag, then the audio you have on your page will play just once.

So there you have it! The power of the background sound is now in your hands. It is up to you what you will do with it.

Learn more about this author, Tim StS.
Click here to send this author comments or questions.

Helium Debate

Cast your vote!

Does digital rights management (DRM) promote or prevent piracy?

Click for your side.

269687

Featured Partner

Population Services International

PSI is a leading global health organization with programs targeting malaria, child survival, HIV and reproductive health. Working in partnership within the public and private sectors, and harnessing the power of markets, PSI provides lif...more


CONNECT WITH US

Read
our blog
Helum for writers

Write and get published
Share with other writers
Polish your freelancing skills

Join our active writing community
Helium Content Source for Publishers

Quality articles from proven freelancers
Exclusive rights, fast turnaround
Brand engagement, business blogging -- our writers do it all

Get custom content today!

INFORMATION


Helium, Inc.
200 Brickstone Square Andover, MA 01810 USA
#