Producing web pages
* HTML CSS DHTML XHTML A to Z of tags        Accessibility          Design

Adding sounds

To add background sounds or music to your page, use the <bgsound> tag. You specify the address of a sound file (such as a wav, au, or MIDI file) and use the loop attribute to set how often the file plays.

For example:

<bgsound src="boing.wav" loop="5">

If you set the loop attribute to infinite or -1, the music plays continuously.

Netscape does not support the <bgsound> tag; use the <embed> tag instead.

You can also link to a sound file in the same way that you link to another page. You might want to include a graphic to show you have a sound file. For example:

<a href="tada.wav">
<img src="sound.gif" width="32" height="32" 
alt="Sound button">Play fanfare</a>

This would look like:

You can also use the <meta> tag to play a sound automatically when a page loads. Include a line in the header section of your page:

<meta http-equiv="refresh" content="0"; url="tada.wav">