www.webdeveloper.com
Results 1 to 8 of 8

Thread: Stringing multiple sounds together.

  1. #1
    Join Date
    Dec 2002
    Location
    Suffolk, England
    Posts
    3

    Stringing multiple sounds together.

    Does anyone know how to link sounds so they play back to back?

    I've been asking at a different forum but noone whos replied knows how yet so I thought I'd give this one a try instead any way!

    I want to link some sounds together from friends websites, I have written the old:

    <EMBED src=http://www. hidden=true loop="false" autostart="true" width="1" height="1">
    <EMBED src=http://www. hidden=true loop="false" autostart="false" width="1" height="1">
    <EMBED src=http://www. hidden=true loop="false" autostart="false" width="1" height="1">
    <EMBED src=http://www. hidden=true loop="false" autostart="false" width="1" height="1">
    <EMBED src=http://www. hidden=true loop="false" autostart="false" width="1" height="1">
    <EMBED src=http://www. hidden=true loop="false" autostart="false" width="1" height="1">

    but I have no way of getting them to play one after another, I can't record them as one and then upload it due to restrictions on my server.

    I've had 2 suggestions but to no avail; an i-frame but I couldn't get this to work and a single embed being manipulated by java but I don't know any Java.

    I found something about using timenodes but this seemed very complicated and I'm a bit of a newbie t coding.

    Any help would be great.

    Thanks

    Spamfritter
    Be patient I am a true beginner

  2. #2
    Join Date
    Nov 2002
    Location
    Hove, UK
    Posts
    160
    You could try using Flash to regulate their start and stop times

  3. #3
    Join Date
    Dec 2002
    Location
    Suffolk, England
    Posts
    3

    That's a bit of overkill isn't it?

    OK but that sounds like major overkill isn't it?
    I only want it to play the sounds one after another, a trigger maybe or something like that, but flash?? I'd have to learn how to use it. Any other suggestions??

    You could try using Flash to regulate their start and stop times
    There must be a way to do this with just plain old HTML isn't there??

    Thanks for the suggestion all the same.

    Merry Christmas.

    Spamfritter
    Be patient I am a true beginner

  4. #4
    Join Date
    Dec 2002
    Location
    Suffolk, England
    Posts
    3

    I've sourced 2 codes but neither work

    Research has turned up 2 codes but I can get neither to work

    one is

    Code:
    <html>
    <SCRIPT language=JavaScript>
    <!-all times must be in millisecs>
    timer=""
    index = 0
    loadtime = 2500 // time allowed for downloading
    loadnum = 0
    stopped = 1
    
    song=new Array() // File name, Song Title, Playing Time
    song[song.length]=new Array("http://www.necrosdomain.co.uk/downloads/tvthemes/gadget.wav","Inspector Gadget",73000)
    song[song.length]=new Array("http://www.necrosdomain.co.uk/downloads/tvthemes/dangermo.wav","Dangermouse",33000)
    song[song.length]=new Array("http://www.tvthemetunes.net/_tv/b/buttonm.wav","Button Moon",32000)
    song[song.length]=new Array("http://www.tvthemetunes.net/_tv/b/bodgbadg.mp3","Bodger & Badger",17000)
    song[song.length]=new Array("http://www.trenchman.com/sounds/hammer.wav","Hammerman",72000)
    song[song.length]=new Array("http://www.tvthemetunes.net/_tv/b/bstar.wav","Bravestar",67000)
    
    function init(){
    index = Math.floor(Math.random() * song.length)
    //index=0 // 
    change()
    }
    
    function change(){
    stopped=0
    clearTimeout(timer);
    if(index==song.length){
    index=0;
    document.all.track.src = song[0][0]
    }
    else{
    document.all.track.src = song[index][0]
    }
    window.status="PlayList ---- > Track "+(index+1)+" of "+song.length+" <<< "+song[index][1].substring(song[index][1].length,0)+" >>>"
    
    if(loadnum<song.length{ // if played for first time add download time to play time
    next=song[index][2]+loadtime
    loadnum++
    index++
    timer=setTimeout("change()",next)}
    }
    }
    
    function stop(){
    if(stopped==1){return}
    stopped=1
    clearTimeout(timer);
    index=index-1
    document.all.track.src =""
    windows.status="Player Stopped"
    }
    setTimeout("init()",2000)
    //-->
    </SCRIPT>
    
    <BGSOUND SCR="" ID="track" VOLUME="80">
    
    </html>
    the other is

    Code:
    <HTML>
    
    
    <SCRIPT language=JavaScript>
    timer=""
    a = 0
    time = new array()
    time[time.length] = 73000
    time[time.length] = 33000
    time[time.length] = 32000
    time[time.length] = 17000
    time[time.length] = 72000
    time[time.length] = 67000
    
    function init(){
    a = Math.floor(Math.random() * document.embeds.length)
    change()
    }
    
    function change (){
    clearTiemout(timer);
    if(a==document.embeds.length){
    a=0;
    documents.all.track.src = document.embeds[0].src
    }
    
    document.all.track.src = document.embeds[a].src
    windows.status="Track "+(a+1)+" of "+document.embeds.length+"  <<<"+document.embeds
    [a].src.substring(document.embeds[a].src.length-4,0+" >>>"
    timer=setTimeout("change()",time[a]);
    a++
    }
    
    )
    function stop(){
    clearTimeout(timer);
    a=a-1;
    document.all.track.src =""
    window.status="Player Stopped"
    }
    setTimeout("init()",2000)
    //-->
    </SCRIPT> 
    </HEAD><BODY>
    
    <EMBED src=http://www.necrosdomain.co.uk/downloads/tvthemes/gadget.wav hidden=true loop="false" autostart="false" width="1" height="1" mastersound>
    <EMBED src=http://www.necrosdomain.co.uk/downloads/tvthemes/dangermo.wav true loop="false" autostart="false" width="1" height="1" mastersound>
    <EMBED src=http://www.tvthemetunes.net/_tv/b/buttonm.wav hidden=true loop="false" autostart="false" width="1" height="1" mastersound>
    <EMBED src=http://www.tvthemetunes.net/_tv/b/bodgbadg.mp3 hidden=true loop="false" autostart="false" width="1" height="1" mastersound>
    <EMBED src=http://www.trenchman.com/sounds/hammer.wav hidden=true loop="false" autostart="false" width="1" height="1" mastersound>
    <EMBED src=http://www.tvthemetunes.net/_tv/b/bstar.wav hidden=true loop="false" autostart="false" width="1" height="1" mastersound>
    
    <BGSOUND SRC="" ID="track" VOLUME="0"&gt;&lt;!-- || -3000 to 0 || -->
    </BODY></HTML>
    troubleshooting on either would be fantastic if anyone can.

    Thanks

    Spamfritter
    Last edited by spamfritter; 12-20-2002 at 05:50 PM.
    Be patient I am a true beginner

  5. #5
    Join Date
    May 2006
    Posts
    3
    ok, i do know how you can ajust this to make it work, i have, but i dont have a specific example to do it, i do, however, have a website that uses this if u would like to view>source on it, please email me: Colton22@comcast.net
    thanks

    colton22

    ps: check out my site> http://www.freewebs.com/colton22
    but it doesnt have this topic on there :'(

  6. #6
    Join Date
    Jun 2006
    Posts
    1

  7. #7
    Join Date
    May 2006
    Posts
    3

    music back2back

    i got the code and it works but if the user takes longer to load a song, the timing is a lil off so use a "cusion" with some extra seconds...

    this is directly from my website so the form i used was formname=_song and selectname=_list

    var extratime=20; //seconds
    function readyNewSong() {

    if (currentsongIndex==eval(window.document._play._list.length-1)) {currentsongIndex=1;}
    else {currentsongIndex++;}
    window.document._play._list.selectedIndex=currentsongIndex;
    changeSong();
    }
    function timeoutsongs() {
    counterforsongs++;
    }
    function _songTimeout(time2wait) {songTimeoutRunning=true; //alert("running");
    if (counterforsongs==time2wait) {timeoutsongs(); readyNewSong();}
    else {timeoutsongs(); setTimeout("_songTimeout("+time2wait+")",1000);}
    }
    function _setSongTimeout(time2send) {
    counterforsongs=0;
    _songTimeout(eval(time2send+extratime));
    }
    function clearTimeoutVariables() {timer4songTimeout=0;}
    Colton22

  8. #8
    Join Date
    Jun 2006
    Posts
    1
    did u try not clicking on play when page loads

    I dont understand your question

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles