to home page


Background  
Free music!
 


Adding Background Sounds

HOME
TUTORIALS
LINKS
FORUM
GLOSSARY
NEWS/ABOUT

 

THIS AREA

MAIN

BASICS
Basic Tutorial
Advance Tutorial

Beyond Tips
frames
sound
  Main
  File Types
  Delivery
  Recording
  Link to Sound
  Embedding sound
  Background
video

Composer Hints

Reviews

 

 

BWRS
SEARCH

 

 

 


Background sounds or music are extensively used on the web. Ranging from simple intro effects as you heard here to music played in the background. Remember sound files can occupy a large amount of space

The principles are essentially the same as creating an embedded sound files into the pages which we've dealt with already

Lets run through how to add a simple sound file (wav.) as background effect.

Lets begin with setting up a background sound as it is essentially the same technique as creating an embedded file. Click below to hear an example

 

Okay so we didn't use a particularly wonderful sound file but it's a good example

Audio is one area where browser incompatibility makes things different but the code we've used sorts that largely out. It relies on using the <embed> tag.

Just enter it in HTML either of the two methods we've descibed before (remember if you use insert -> HTML tag to seperate add </embed>)

<embed src="test.wav" autostart="true"
hidden="yes" width="0" height="0" loop="false">
</embed>

lets break that down by each attribute

<embed src="test.wav"
Tells the browser to embed the sound file called "test.wav" in the document (you could use an absolute or relative URL to a sound file if you wish just like a graphic)

autostart="true"
Tells the browser to automatically play the sound file (if not you'll need to display the controls to allow users to do so- see below). Values are true or false.

Hidden="true" width="0" height="0"
are used here to hide other sound controls. Hidden only seems to work for Netscape whilst making the size of the controls 0 x 0 will work for both Explore and navigator. Obviously you'd leave out the hidden attribute and give the sizes bigger value if you wanted to give your viewer some control.

loop="false"
Tell the browser not to repeat (loop) the file. If set at true or infinite will run add nauseam or you can assign a value. Note it appears you must have some of the sound control unit present for this to work with navigator (try setting width and height at "10" and tuck it in a corner of your page)

Back to top

Okay. Now that will allow you to have background sounds that run on both main browsers.

However there are other ways of doing this. The problem is audio use is the biggest area browser incompatibility.

Internet explorer users can enjoy back ground sound through the very handy <bgsound> tag

The essentials of the example below are coded by
<bgsound src="test.wav" loop=infinite>

It is a wonderful does exactly what the name says tag which cuts out several attributes. Sadly not yet supported by Netscape (last tried v4.7)

Another is the use of a tag called <object>. This is a jack of all trades tag and allows you to use many items called objects on a web page which include things like sound video and will eventually replace the <embed> (and the<applet> tag)

Guess what ? It doesn't work as yet for Internet Explorer!!

We've mentioned these 2 primarily for the future. Some advocate the use of multiple tags to cover all eventualities but you run the risk of getting numerously simultaneous file run interfering with each other. The embed tag is a pretty safe way of doing things and although will be depreciated will be usable for some time after that even on the latest browser

As a rule, we don't like background sounds for rather obvious reasons.

We find intro sounds a bit gimmicky and really detest background music. You really might enjoy your rendition of Vivaldi on a stylophone. But not everyone else will, especially if its stuck on a permanent loop, so put a set of on-off controls or you might find your hit count dropping.Back to top


Embedded SoundsEmbedded Sound FilesSounds Mainstreaming mediaStreaming Media
  Sounds Main Menu  

terms & conditions copyright © 1999-2003 legal notices
home
credits
contact us link to us