How to Play Background sound in your web page

If you wish to play a background sound automatically when display the web page you can use the following html code for that

embed src="musicfile.filetype" autostart="true" loop="true" width="2" height="0" >

In the above code you can use either loop true or false.If use loop equals true then the sound file play repeatedly to the closing of web page.If use loop equals false the sound file play exactly one time.

You can also use the following code.

bgsound src="music/song.mp3" loop="-1">

You can give the value to the loop.Loop equals -1 means the sound repeatedly play until close the page and also you can give number for the loop for represent the exact times you want to play the sound.

1 comment:

  1. Hi!,
    I want to know how to play few number of sound files randomly one at a time. Do you have any answer?