How To Play Background Audio Files On Your Website

Google+ Pinterest LinkedIn Tumblr +

Step 1:

Determine which piece of music you will be using. Make sure you have permission to use the music you wold like to have playing in the background of your webpage.

Step 2:

Select the format you would like to use.

Midi files are extremely small. They are synthesized music files and lack any vocals.

Wave files are the natural format that a audio file is saved in from its raw stated. Wave files are generally very large files and is real music and contains vocals. Wave files also require an external media player to play the audio file.

Mp3 files are files that are compressed from the wave or raw stream. The quality lose in mp3’s are not noticeble to the untrained ear, that is the average person would not notice the difference. Mp3 files are smaller than wave files and generally larger than midi files.

Mp3 and Wave files have the disadvantage of needing to be loaded into the external media player’s buffer to be played. This could cause the bbackground music to be choppy at times, depending on the memory constraints.

Step 3:

Convert your audio file to the desired format.

Step 4:

Load the audio file onto your website using a ftp program or an http interface program provided by the server provider.

step 5:

Add the following html coding to your html file within the body.

<embed src=”” autostart=”true” loop=”false” hidden=”false” width=”350″ height=”200″>Note all the parameters for the attributes are in quotes.

src= will point to your music file. The parameter should be the URL in quotes.

autostart = “true” or “false” and will start the playing of the file as soon as it is loaded into memory or not.Autostart must be set to “true” if you plan to hide the media player or there will never be any music played

loop=”false” or “true” this will continuously restart the music file over if set to true and play the music file only once if set to “false”

hidden=”false” or “true” this will either hide or make visible the media player. This should be set to “false” giving the visitor the option to turn of the media player. If you webpage does not have the space for media player control then set hidden=”true” and set loop=”false” so that the visitor does not have to forced to listen to the same music over and over again.

width and height are the dimensions of the medi player controller.

Note: You can play multiple audio files by creating an m3u file, uploading it to your website and inserting the m3u file URL as the src=parameter.

An m3u is a plain text file with the .m3u extentsion. In the m3u file is the URL of each audio file in the playlist. It audio file URL should be contained on a separate line.



About Author

Leave A Reply