Browse DevX
Sign up for e-mail newsletters from DevX


Inserting Audio : Page 4

In this section, you'll learn how to insert audio into your site.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Adding Background Sound
Looking for some atmosphere for your site? Add a little background sound and enhance the mood of your site.


Background sound works only with IE, and adds a background sound to your page. The bgsound tag has two switches:

src=URLname gives the name of the sound file you want to play in the background.

loop=X/infinite lets you replay the sound a specific number of times or continually. Do not use loop=0 or loop=1, however. Different browsers interpret this same command differently. Also, avoid using loop=infinite, it doesn't work on some browsers. It's best to write loop="false," if you want your file to play one time, and loop="-1" if you want the file to play over and over again.

  • For example, this code plays the sound file named "JAhat.mid":
    <bgsound src="../AZsounds/azAudiologos/JAhat.mid">

  • This one plays it five times in a row:

    <bgsound src="../AZsounds/az/Audiologos/JAhat.mid" loop=5>

  • This one plays it over and over as long as the page is in the browser window:
    <bgsound src="../AZsounds/JAhat.mid" loop="-1">

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date