BGSound: Background music on your website

When web pages began their rise on the Internet, background music was part of all of them. It was very curious. You were with your computer browsing from one site to another… and if you had been careless leaving your speakers on… suddenly… chan ta ta ta chan…. Star Wars music in the background.

Such was my passion at the time for collecting midis that I had the Midistore page, which brought together midis from hundreds of groups. Now midi has been completely relegated to the background. Set ringtone, polytone, soundtone or videotone on your mobile. Who sets a tone now? With how nice it is to listen to Shakira in the background.

Now it is no longer in style. We went from the Rococo era, with pages full of colors, images, flash, background music,… to simple pages that are more concerned with being usable and accessible than with the color they can give. Although for tastes, colors. And we still find some pages with thousands of special effects out there.

Well, our example comes to teach us how to put a midi as background music on our website, and of course, we couldn’t choose anything other than the one from “Star Wars”… you’ll see how cute it is.

Putting the midi in the background of the page is very simple, let’s see how…

The Internet Explorer pioneered this by adding its BGSOUND tag to the tag (You can see information about this tag on MSDN)

      

The most important thing about this tag is that to indicate the midi file you must use the src attribute. Other attributes of interest are:

  • loop, which allows the song to start over every time it ends. We can either indicate a specific number of repetitions (giving it the value of a number) or that it be infinite (giving it the value “infinite”)
  • delay, value to delay the start of the music. Positive number in seconds.
  • volume determines the intensity of the background sound. Values ​​range from -10,000 (weakest) to 0 (highest). It is not supported by Macs.
  • balance,…
      

The problem is that BGSOUND is still an extension of Internet Explorer. Now, if your target audience uses that browser and you are no more papist than the Pope… So go ahead. Now what a surprise, surprise… Opera also supports this tag.