Click to See Complete Forum and Search --> : Adding more background songs


georgeafi
07-15-2003, 10:52 AM
Hey, i have a code on my site to play small wav files but what i am wondering is if there is anyway to add more songs to it and have it play them randomly? Alot of people have told me they like having the background music but i should try and make it so there was more than one song over and over again. Hopefully i can. If anyone know can you pleese help me? THe code i use on my site is below.

Thanks,

Here's the code i have on my site.

<div style="position: absolute; top: 5px; left: 80px; width: 70px; height: 22px; z-index: 2;"><embed src="http://www.miseriacantare.com/songs/AFI%20-%20Sing%20the%20Sorrow%20-%2013%20-%20This%20Time%20Imperfect%20(Hidden%20Track)%20[aca-fenixdown].wav" Autostart="true" hidden="false" height="22" width="70" loop="4"></embed></div>

CyCo
07-15-2003, 11:23 AM
...more info on this subject can be found here...

http://forums.webdeveloper.com/showthread.php?s=&threadid=8119&highlight=more+than+one+sound

georgeafi
07-15-2003, 11:39 AM
I don't know what i am doing wrong but it won't even show up on my page. I put the code where it told me but theres nothing. And the files i have aren't Midi files. The are wav. and are about 500kb. I'll try and mess with it i guess. I also like having a windows player or real player to play the files though.

georgeafi
07-15-2003, 11:56 AM
Well that script for the midi player isn't going to work for me cause it says it doens't appear with Internet Explorer. So i can't use that. If i can i want to use the same script that i post on tha top.

georgeafi
07-15-2003, 12:48 PM
Ok, i search aroung and i found this code. The only thing is when i use it the songs play but there is a loud sound that is blocking it too. It sounds like when you blow into a microphone. Heres the link to the test page where I put the code. Can someone help with why it is doing this? I can't figure it out.

http://georgeafi.bravepages.com/test.html


And heres the code,




<body>
<script language="javascript" type="text/javascript">
<!--hide

for (i=0; i<100; i++)
{
var x = Math.random()*3

var sound1="song1.mid"
var sound2="song2.mid"
var sound3="song3.mid"

if(x<=1)var sound=sound1
else if(x<=2)var sound=sound2
else var sound=sound3

document.write('<bgsound src='+'"'+sound+'"'+'loop="false">')

}
//END hide-->
</script>
</body>