PDA

View Full Version : background music


trianth
03-06-2004, 10:52 PM
thanks for the help with the background graphic, everyone...but now I'm on to something that I KNOW I need help with doing; getting bg music to play on my website. Well, I went to the Hardcore mode and found that I could do it, but I was surprised to find out that it wasn't working...I typed in the song name and everything...<bgsound src="music.mp3" balance="-10000|10000" loop="infinite|value" volume="-10000|0=max">

and no, that isn't the name of the song, but same concept, right? oh, and I also found that the bg graphic needed to have a "..\" in front of the name for some reason...maybe because it was in a folder? ah, well, thanks for the help:D

pascal
03-07-2004, 01:20 AM
Maybe it's a problem with your browser.

Try this script:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
function playSound() {
if (navigator.appName == 'Netscape') {
if (parseInt(navigator.appVersion) >= 3) {
if (navigator.javaEnabled()) {
if (navigator.mimeTypes['audio/midi'] != null) {
if (navigator.mimeTypes['audio/midi'].enabledPlugin != null) {
document.firstSound.play(false); // play sound in Netscape
}
else
alert('Your browser does not have a plug-in to play audio/midi mime types!');
}
else
alert('Your browser does not support the audio/midi mime type!');
}
else
alert('Requires Java enabled to be enabled');
}
else
alert('Only works in Netscape Navigator 3 or greater');
}
else {
if (document.embeds) {
document.embeds[0].run(); // play sound in Explorer
}
else
alert('Your browser does not support the embeds array');
}
}

function pauseSound() { document.firstSound.pause(); }
function stopSound() { document.firstSound.stop(); }
//--></SCRIPT>
</HEAD>
<BODY>

<EMBED SRC="sound.mid" HIDDEN="TRUE" AUTOSTART="FALSE" LOOP="FALSE" NAME="firstSound" MASTERSOUND>

<A HREF="javascript:playSound()">Play the sound now!</A> -
<A HREF="javascript:pauseSound()">Pause/Restart the sound</A> -
<A HREF="javascript:stopSound()">Stop the sound</A>

</BODY>
</HTML>

If you preview it, and you see this:
"Play the sound now! - Pause/Restart the sound - Stop the sound "
then you know your browser does support music files.

Check this site about how to control music files:
http://developer.irt.org/script/191.htm

MikeParent
03-07-2004, 06:29 AM
Just so you know, background music is evil... :-)

If I hit a site and it has background music I search frantically for how to stop it and if I can't I leave immediately. I usually already have music going when I surf and find this particularly annoying.

That said, the bottom line I guess is "know your audience"... if you think they'll dig it then go for it..

pascal
03-08-2004, 08:54 AM
Even when you go to a site from a band?

You see, I build a website for a friend, about his band.
He want background-music at the site, but i'm not sure wether it's good or not.

azlatin2000
03-08-2004, 12:03 PM
I think you should embed it at the top of the page and give them the option of turning it on becaUSE IT REALLY GETS ON MY NERVES WHEN THERE IS BG MUSIC PLAYING AND I AM WTCHING TV AND THEN I HAVE TO SEARCH HOW TO TURN IT OFF AND THEN IF I REFRESH THE PAGE ITS STARTS PLAYING.

Sorry about the caps but i accidentally pressed caps lock and i am to lazy to retype everything.

pascal
03-08-2004, 12:51 PM
Too bad you can't control the volume...

azlatin2000
03-08-2004, 01:35 PM
Actually if you embed it there should be a volume bar by default

MikeParent
03-08-2004, 03:32 PM
Actually a short non-repeating clip might be OK in this case, but otherwise I would have it off by default and provide a way for allowing people to listen at their option. Or better yet provide an MP3 download page.