Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts

    javascript sound layering?

    just wanting to know if it is possible to play 2 sounds at the same time, or start one and then playing another without the first one being turned off, in javascript or like scripting using IE6.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes...Try this:
    <EMBED SRC="sound1.wav" autostart="true"
    hidden="true" loop="false">
    <EMBED SRC="sound2.mp3" autostart="true"
    hidden="true" loop="false">
    Dunno why you'd want to hear 2 sounds at the same time 'cause it turns out garbled...Nevertheless, ytou can also mix 2 or 20 sounds in one file with an editor.

    Chitty bang bang we love youuuuuuuuuuuu.
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    ColoRockyz
    Posts
    1,646
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Oh..you want to bloat...I mean play with js? Dunno
    Zoobie or not Zoobie...That is the problem.
    <body onUnload="flush( ! )">

  • #4
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts

    not quite what i meant

    I am creating a game that uses audio files as an added effect. with this game i want to be able to play multiple sounds at one time without one turning off so the other one can play. I use the <embed> for all my sounds, which helps with loading, but i can still only play one sound at a time.
    for example, i have a timer for the game, when it reaches red, a sound file plays that says "hurry up" well this sounds is approx. 3-4 seconds long. but at the same time the player is clicking on images that when clicked on makes sounds them selves that are only .5-1 second in length. i dont want the " hurry up" sound being stop prematurly so that the click sound can play. i am currently using the script:

    <embed src='loser.mp3' autostart=false hidden=true loop=false MASTERSOUND>
    <script>
    function playS(snd){
    document.all.base.src=snd}</script>

    i also tried the

    document.embeds[0].play(false);
    document.embeds[0].play();

    but it doesnt wnat to work for me.


  •  

    Posting Permissions

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