Playing sounds in java application

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Torquemada
    New Member
    • Feb 2006
    • 5

    #1

    Playing sounds in java application

    Hello I want to know why my applications stops responding for approx. 1 sec when I play sounds rapidly.

    This is the method I use

    private void playSound(int index)
    {
    //sound.stop();
    sound = JApplet.newAudi oClip(url[index]);
    sound.play();
    }



    The index points to a specific URL array which keeps the location of the wav. file.
    If I play sounds repeatiply say every 100ms the application stops responding for 1 sec. If I stop the previous sound with sound.stop() then it´s ok but I want the new sound to overlap the old one not to restart it.
  • Torquemada
    New Member
    • Feb 2006
    • 5

    #2
    This is the second forum I have asked the same question without any reply. Can nobody help?

    Comment

    • Niheel
      Recognized Expert Moderator Top Contributor
      • Jul 2005
      • 2433

      #3
      You don't want there to be a delay inbetween songs? Is this for a web-application or desktop application?
      niheel @ bytes

      Comment

      • Torquemada
        New Member
        • Feb 2006
        • 5

        #4
        It´s a desktop application. Im making a space-shooter game, when you click the fire button the space ship shoots laser and a laser sound is played. You can shoot very fast so when you fire the second laser the other laser-sound is already playing and the new laser sound overlaps the old one. The problem is when I fire rapidly the application stops responding for a second as if it can´t handle so many sounds at a time.

        Comment

        • vocabList32
          New Member
          • Mar 2006
          • 1

          #5
          Business technology, IT news, product reviews and enterprise IT strategies.

          Comment

          • Torquemada
            New Member
            • Feb 2006
            • 5

            #6
            Using the sun.audio package seems to work much better, thanks for the link.

            Comment

            Working...