Click to See Complete Forum and Search --> : help with BG music


georgeafi
07-15-2003, 03:01 PM
I found this code for background music but when i go to the page it makes a scrambled sound instead of the music. You can still hear the music too but i don't know why it makes the scrambled sound. Can someone help? Here's the link to the test page i put it on.


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


And heres the code that i am using.



quote:




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>

georgeafi
07-15-2003, 05:19 PM
Can anyone help? I either want to use the code above that isn't working right, or this code below that i can't get to play random wav files.

<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[a
ca-fenixdown].wav" Autostart="true" hidden="false" height="22" width="70" loop="4"></embed></div>


Pleese help if you can.

georgeafi
07-15-2003, 10:57 PM
Sorry for bumping this up again but i really need to find a code for this. All the ones i have found don't work. The ones i have found is the one i posted on the first post and the one below. If you know anything to help pleese tell me.



<script>
<!--
//By George Chiang (http://www.wsabstract.com) More JavaScripts here!
var sound1="first.mid"
var sound2="second.mid"
var sound3="third.mid"
var sound4="fourth.mid"
var sound5="fifth.mid"
var sound6="sixth.mid"
var sound7="seventh.mid"
var sound8="eighth.mid"
var sound9="ninth.mid"
var sound10="tenth.mid"
var x=Math.round(Math.random()*9)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else if (x==4) x=sound5
else if (x==5) x=sound6
else if (x==6) x=sound7
else if (x==7) x=sound8
else if (x==8) x=sound9
else x=sound10
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
//-->
</script>

georgeafi
07-16-2003, 12:20 AM
Ok i finally found a code that works. The only thing i would like it to do is load without opening a window and if i can, have it play in a small real player or windows media player that is in the same window or mabey even in a different frame. i don't know if i can change the code to do any of this. I would atleast like to have all the songs play in a small media player so there isn't one poping up.

Heres the page if you want to try it.
http://georgeafi.bravepages.com/test2.html

And here is the code.

<form>
<p align="center"><select name="s" size="1">
<option value>Choose an AFI song to listen too</option>
<option value="songs/number1.wav">Synesthesia</option>
<option value="songs/number2.wav">Siver and Cold</option>
<option value="songs/number3.wav">Miseria Cantare</option>
</select></p>
<div align="center"><center><table border="0" cellpadding="3"
cellspacing="5">
<tr>
<td><input type="button" name="play"
value=" Play "
onclick="window.top.parent.location=s.options[s.selectedIndex].value"></td>
</tr>
</table>
</center></div>
</form>