HTML Recipes

Graphics
Downloads

How to add a background sound to your website ~ You must keep in mind that SIZE counts here, keep it small, or your visitors will be looking at a blank screen a long time!! NO 5 MB mp3 attempts or wavs... KEEP IT SMALL>.... UNDER 50 kb is my suggestion.

The code below is duplicated, with NS and IE codes, just change the file name and you are good to go. You can use WAV or MIDI on most servers with no problem. ( NS prefers the embed code, and IE prefers the bgsound code. ) 

In the code below.... once copy and pasted, change the file name from sound.mid to the filename.wav or filename.midi ~ make sure CaSe is correct.....

This one will play the wav/ sound file with no controls.... note the HIDDEN in the code....

Just copy and paste and edit the code, and place after the body tag in your html. AND do not forget to upload the file to your server as well! 

This one will give you a nice player control....

Couple of tips......

  • autostart means that if TRUE will load sound when page is loaded. FALSE should give a small control for NS viewers.
  • loop means how many times the wav or midi will play. -1 will make it play forever.
  • width and height will set the control size.
Who is HomeMade? Meet Sugz, Lexsis,  Nhyrvana, Shear, and E2C.

link to us!

Did we help you? Then please link back!

Content and images copyright ? 2003-2004 HomeMadeHTML.com

* Disclaimer : HomeMadeHTML.com does not intend to be the complete or total HTML resource, but rather a place where we can answer questions we frequently get when building sites, and questions we see asked in help rooms and emails. The site is a point to interact and make available help to all levels of users. You can't find your problem or solution listed? Mail it in or search the web, and good luck! All questions submitted and their solutions become the property of HomeMadeHTML.com and may be published in part or in its entirety on this site. All programs and sites listed or referenced on this site are Copyrighted by their respective owners.