Tuesday, April 7, 2009

How to Add Background Music to Your Blog

As you know, I'm a Blogger.com user. Unfortunately, Blogger doesn't provide us with an easy way to add background music. So how to embed some best-loved music in your blog? It's actually quite simple to do this, and read on to see various methods you can use.

In this post, I'll concentrate on actually embedding the music, rather than adding widgets such as Last.fm playlists.

The easiest method of adding background sound is to include a line like this in your blog template, just after the opening tag.

[bgsound src="http://yoursite.com/yoursound.mp3" loop=infinite]

Note: you need to replace "[" and "]" with "<" and ">" respectively to make the code work.

where the URL is that of the background music you wish to use. This method works perfectly well, but visitors to your site will not be able to switch the music off if it becomes distracting.

So instead, you may prefer to use another method instead, which is compatible with all browsers. This is achieved by including the following code somewhere in your template.

[embed width="200" src="http://yoursite.com/yourmusic.mp3" autostart="false" loop="false" height="50"][/embed]

You can change some of the variables to suit your needs:

  • autostart: set to "true" to make the music begin as soon as the page is loaded, or "false" to ensure the user has to press the play icon.
  • loop: set to "true" to have the music play over and over, or "false" so that it plays only once.
  • height: if this is set to "40", only the play options will be visible. You can make this larger if you prefer, in which case blank space will be visible.

Ok, the how-to is done, and now it should be "problemless" for you to add music to your blog. Let's rock the blog!

1 comment:

  1. You need to be a part of a contest for one of the best
    blogs online. I will recommend this blog!

    my weblog; interpreter chinese

    ReplyDelete