How to Add Background Music to a Web Page


Would you like to have music sweetly playing in the background while users navigate your site? If you do, then you just have to follow these simple tips to make that happen:

1. Upload the audio file that you would like to be played.

It could be a wav, au, aiff, or midi file. You have to access your hosting account through FTP. Once you’re in your domain’s root folder, transfer the audio file of your choice.

2. Open the main HTML file of your website, which is usually called index.html

Right in the same place where you placed the audio file (provided that you transferred it in the root directory), you’ll see an index.html file. Open that up using a text or an html editor. You can simply right click on it and click edit on the options.

3. Anywhere inside the <body> </body> tags, copy and paste this code:

<EMBED SRC=”audiofile.wav” HIDDEN=TRUE
AUTOSTART=TRUE LOOP=TRUE>

You have to change audiofile.wav into the actual file name of the sound file that you have uploaded. HIDDEN=TRUE would load the audio file without the sound control panel showing up. AUTOSTART=TRUE would play the music automatically. LOOP=TRUE would play the sound continuously.

4. Save the edited text and visit your site. You should have your music playing!

***Note: Make a backup of your index.html file before following these steps. Work accurately to prevent mistakes. Erroneous changes on your index.html file may cause your website not to load properly. Take extra care when performing this tip.