Forum Moderators: not2easy
I have a friend that has done a few demos that he has placed on a CD. He wants to create a small website and have people visit the site and listen to his songs on demand. What he wants is for the song to play in the background without the person downloading anything or opening another program.
But how do we do this. Do I create a new folder put the songs in there then on the home page create links so that if the person clicks song A begins to play and then clicks on aonther link and song b begins to play.
Can someone help us on this issue?
There are two common ways to add background music to a web site. The first involves a simple link, the second is more tenacious - you actually embed the music right into the site, so it begins to play as soon as someone begins to view the page.
ADDING A SIMPLE LINK
You can give your viewers the option to listen to music that flows with the theme of your web site by including a clickable link to the music file. The music can be in a variety of formats, including mid (midi), wav, MP3, ram, ra, aiff, and so on), and it is solely up to the viewer whether they listen to it or not, as they browse your site. You can provide a simple text link to the file or create a coordinating image to take them there.
Example Text Link:
<A HREF="http://www.yourdomain.com/beautifulday.wav">Listen to Music</A>
Which would look like:
Listen to Music
Example Graphic Link::
<A HREF="http://www.yourdomain.com/floating.wav"> <img src="http://www.visionsofadonai.com/musicbutton.jpg" border=0 ></A>
This would ultimately look like this (Music by Djan Karet, Dreamscapes):
EMBEDDING MUSIC
Sound can be embedded so that the music plays as soon as a web page is opened. You simply need to place appropriate code on your page. For instance, to embed a wav file of a song called "Beautiful Day". you would put the following code into your html coding (this works for various sound files such as mid, wav, mp3, ra, aiff):
<EMBED SRC="beautifulday.wav" HIDDEN=true AUTOSTART=true>
<NOEMBED><BGSOUND SRC="beautifulday.wav"></NOEMBED>
Coding a Console:
The above code works well to embed background music, but it does not allow the viewer to control whether to listen to the music or not. If you wish to give them a choice, use the following code:
<embed src="beautifulday.wav" width="140" height="40" autostart="true" loop="true"> </embed>
If you do not want the music to loop (play repeatedly) you can change the loop="true" command to "false". You can also customize the size of the control panel that emerges by varying the width and height within the above code.
Make sure you have rights to the music file before you use it!
I did a website for a band and instead created a link to a pop-up which has an embedded media player. The page automatically generates a random playlist and starts playing. There's also selections for albums, songs etc... kind of like a little personal radio. the users like it quite a bit.
You will also find .mpgs will compress far better, .wavs are huge. If you put an mpg into your Flash, it will load faster, Flash will stream it, and you can effect all sorts of controls on the sound besides starting and stopping.
Do a search for embedding a media player, there's literally hundreds of ways of doing this. To allow for selections the best method I've seen is using a form with drop down box, from their you need to either use javascript or submit the form to reload the player.
The other method I've seen is using a I-frame, links in one I-frame will reload the player.
You may want to also look into flash players as someone else suggested. There's lots of free ones, simply load up a playlist and supply a link to the player.