View Full Version : Cute background music switch

04-13-2003, 05:37 PM
Check it here:


Allows you to include your own images as switch...

Cute, isn't it?

As always, enjoy!


04-15-2003, 07:38 PM
Is that demo working? I don't hear anything. :rolleyes:

04-15-2003, 07:52 PM
indeed, what browser(s) is it meant to work in?

04-15-2003, 07:52 PM
Likewise. Just static from my overly-turned-up speakers :D

04-15-2003, 08:05 PM
In IE5+

The code is working and fully developed for those browsers.

I just heard it now and tried it in my IE....

04-15-2003, 08:43 PM
I got IE6. Sorry, don't hear it. I've heard sound from some of your other pages, but not this one.

04-21-2003, 09:15 AM
embed sound always acts VERY VERY wierd when i use it.... because regardless of operating system and browser, it either works or does not work... i dont know what the heck it is, but its really anoying, and i cant figure out an easy way to know if it will work or not accept by testing on the individual computer.

p.s yey this is my 200th post :D

04-22-2003, 09:24 PM
Just wanted to say you've got some Very Nice stuff on your site.
Great Work mefriend

08-29-2003, 09:24 PM
just for the record, i was puzzled when it wouldnt play on my box (i am one of those sad people who does put sounds in pages), however, after a check of my mixer settings, i found that midi had been muted, and the example file was indeed midi. i unmuted, it worked fine.

08-29-2003, 10:31 PM
The sound plays but the button to turn it off does not work in Netscape 7 on my MAC.

Having the info on the page about which browsers it works in wold be a good thing. I bet there are people using your scripts mistakenly believing they work in ALL browsers when they don't.

I get this error in the javascript console:

Error: se2 is not defined
Source File: http://www.superprodesign.com/spd/scripts/sounds/backmuim.html
Line: 36


09-03-2003, 05:22 AM
You probably need to place:
<BGSOUND SRC="'+musi+'" autostart='true' LOOP=1>
right after or before
<embed src='"+musi2+"' hidden=true autostart='true' loop=-1>
as for some reason msie 6 on XP does not like the embed command like netscape does. Placing the noembed with the bgsound doesn't seem to work either. I use the following script when using music on my pages:

<script type="text/javascript" language="JavaScript">
<!-- Original: Kipp W. Shinabarger (kipps@bigfoot.com) -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
var MSIE=navigator.userAgent.indexOf("MSIE");
var NETS=navigator.userAgent.indexOf("Netscape");
var OPER=navigator.userAgent.indexOf("Opera");
if((MSIE>-1) || (OPER>-1)) {
document.write("<BGSOUND SRC=music/cheers.mid LOOP=1>");
} else {
document.write("<EMBED SRC=music/cheers.mid AUTOSTART=TRUE ");
document.write("HIDDEN=true VOLUME=100 LOOP=1>");
// End -->

09-03-2003, 06:58 AM
whats interesting though, is that I have seen xp home with ie 6 work with embeded sounds, I actually saw 2 same model dell computers ordered in the same order, with xp home and ie 6, were one worked with embeded sounds and the other did not... Bgsound is a fine alternative for playing background sounds, but ive found that when bgsound is started it has a short delay, and creates a brief lag in the script running were embed does not--- This is anoying to me because I wanted the sounds for a game i was making, embed workes great but as I said bgsound makes it pause for a second-making the game very unsmooth

ps. thanks for that little script, I think that will be usefull to be in the future

09-26-2003, 08:44 PM
I have never ever gotten anything to play in Netscape using standard tags...They used to use Mastersound...but dropped it. Can't really use Real Audio because they keep changing their codecs every 8 months...Can't play .wavs...it's NS. The only thing I've ever gotten to play in NS is Flash which blows away all other methods with small, quick-loading files and is cross-browser. :rolleyes:

09-27-2003, 01:09 AM
a gap in the loop often occurs when using an mp3, the player has to reload the codec, if the sound is small, try using a wav.

when embedding files, i have found it depends on the machine config, for example a friends xp box plays fine using windows media player, another friends 98 opens a qt player in the page, it depends what player is set to be default.

to top it off, i have a win95 machine with ie5, none of the windows sounds work including winamp, causing driverless nasty digital sounds, however i can connect to webradio stations and shockwave.com fine, but only in IE, go figure.

as far as IE is concerned, i only use bgsounds (max of 5) and anything else i use flash (the mp3 loop gap is eradicated)

Mozilla also seems to be strongly dependent on machine config.

09-29-2003, 04:23 AM
To all the nice people that been concerned about my script:

First of all, thank you for your ongoing interest in my script and hope that you enjoyed it and hopefully used it.

As far as playing a sound:

Lastly, I have been working on a perfect method for IE browsers.

The perfect method should have these characteristics:

- Preloaded sounds.
- Not interrupt the flow of the script or transition.
- Compatibility with Real Audio.

I think I've got to a good way of doing this. I have something I would like to share with all the nice people here, but I will be able to as soon as I finish the last details to make sure I'm offering something good.

All what you say is true, but we must find a DHTML/Javascript method, not to resource to flash for another web programming language....

I hope to post a link soon, and after let me know what you think.

SPD :thumbsup:

09-29-2003, 07:01 AM
Not resource to flash but use real audio?
I think real-whateveritsnameisnow-audio died...
Seriously...you should check out flash...yes, it's complicated...but once you start getting the hang of it, you'll see the light...

09-29-2003, 08:17 AM
On the subject of Real, i use Real Helix for streaming audio and video, which will quite happily stream .mp3, .mpg, etc either directly or as part of a .ram playlist, however you really dont want to be encoding audio as a Real format, or your client will have to subscribe to the Real family too, which has grown up to be quite an expencive lock in format! If you search around, you may still be able to find a "Lame" mp3 encoder, or try this lil app

found the below script in my collections, which preloads embeds in netscape and uses bgsound in IE, i also believe flash to be a last resort, due to the expence and potential non install of the plugin or firewall restrictions.

3 parts to this script
part 1
<!-- -->
<SCRIPT LANGUAGE="JavaScript"><!--
// Preload and play audio files with event handler (MouseOver sound)
// designed by JavaScript Archive, (c)1999
// Get more free javascripts at http://jsarchive.8m.com

var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = "Chimes.wav";
aySound[1] = "Ding.wav";
// DO NOT edit below this line

IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//--></SCRIPT><!-- -->

part 2 ----- after body tag

<BGSOUND ID="auIEContainer">
part 3

place withen your link: onMouseOver="playSound(0)" onMouseOut="stopSound(0)"

<A HREF="YourPage.html" onMouseOver="playSound(0)"

09-29-2003, 11:28 AM
Ha ha! I used to use that old script...ahh yes...horse and buggy days. :rolleyes:
*clicks the unsubscribe button*