...

View Full Version : music script? help



JpDm
09-25-2003, 10:42 PM
this is the script i use on my site www.jpdm.vze.com... and everyone says it doesnt work... even though i could hear it just fine(my cookies maybe?) :(

plz help !


<SCRIPT language=JavaScript type=text/javascript>
<!--
my_song=new Array()
my_song[1]="music/one.wma" // first
my_song[2]="music/two.wma" // second
my_song[3]="music/three.wma" // third

function preview(n){
document.all.track.src=my_song[n]
}

function Stop(){
document.all.track.src =""
}
// -->
</script>

<BGSOUND SRC="" ID="track" VOLUME="0">
<form>

<p align="left">

<br>

<input type="image" src="images/1.gif" onclick="preview(0);return false" onload="preview(1)" value="Play 1" name="1" width="27" height="16">
<input type="image" src="images/2.gif" onclick="preview(1);return false" value="Play 2" name="2" width="27" height="16">
<input type="image" src="images/3.gif" onclick="preview(2);return false" value="Play 3" name="3" width="27" height="16">
<input type="image" src="images/4.gif" onclick="Stop();return false" value="Stop" name="4" width="27" height="16">
</p>
</form>
www.jpdm.vze.com

kwhubby
09-25-2003, 11:39 PM
I noticed you are using that script on this page http://www.freewebs.com/jpdm/music.html
It wont play right away because those files for the songs being played, are large so It takes forever to download the file before it will play (it took me about 3 and a half minutes to download that girl.wma seperatly to play in , even on dsl (with about 1.3 mbps speed)). The servers for that site seem to be overloaded (well it is a free service). You might try making the files smaller by using lower sampling rates. Its proboly working on your machine because those files have already been cached to your system, so they dont have to be downloaded.

ALSO! you need to offset your array for your list of songs by -1, you are starting at 1, when the first button plays 0 which is undifined (so only buttons 2 and 3 do anything).

the volume="0" is unesisary.

note** that script you have there will only work for internet explorer, and equivalent browsers (not netscape).

JpDm
09-26-2003, 01:34 AM
aw.. thx

is there any other way to get the music to work?
like putting on a different server or something =\

or some different code to use... i dunno :(

kwhubby
09-26-2003, 05:45 AM
puting on a differnt server might help, but id recomend compressing the audio more, even tho it might not sound really high quality, it would work

JpDm
09-26-2003, 10:04 AM
cool...

i got it down to about 500k (it was around 1meg earlier :o )



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum