Package javax.sound.sampled

Examples of javax.sound.sampled.Clip.stop()


            //clip.setFramePosition(0);
            clip.start()
            try
            {//wait until clip finishes and then close it so it works on OS/2
                sleep(clip.getMicrosecondLength()/1000);
                clip.stop();
                clip.close();
                clip=null;
            } catch (InterruptedException e)
            {
                // TODO Auto-generated catch block
View Full Code Here


                // NOTE: Possible race condition: could become inactive
                // before the stop() is called, which could result in
                // two stop notifications to the update() method.
                // Will the Clip give to stop notifications?
                if (clip.isActive()) {
                    clip.stop();
                }
                clip.setFramePosition(0);
                clip.start();
            }
        }
View Full Code Here

   */
  public void stopBackgroundMusic() {
    Clip c = getSounds().getSound("background");

    if (c != null) {
      c.stop();
    }
  }

  /**
   * Plays the end of battle music once.
View Full Code Here

  public void stopLooping() {
    if (looping != null) {
      if (looping instanceof Clip) {
        Clip clip = (Clip) looping;
        clip.stop();
      } else if (sequencer != null && looping instanceof Sequence) {
        sequencer.stop();
      }
      looping = null;
    }
View Full Code Here

    public void stop()
    {
      Clip myclip = getClip();
      if (myclip != null)
        {
          myclip.stop();
          myclip.setFramePosition(0);
        }
    }
  }
} // class Applet
View Full Code Here

    public void stop()
    {
      Clip myclip = getClip();
      if (myclip != null)
        {
          myclip.stop();
          myclip.setFramePosition(0);
        }
    }
  }
} // class Applet
View Full Code Here

   *
   * @param soundName - the String relative to the clip in the Map
   */
  public void stop(String soundName) {
    Clip cl = this.getSound(soundName);
    cl.stop()
  }
 
  /**
   * Stops the reproduction of all the audio file.
   */
 
View Full Code Here

 
  public static void play(String s, int i) {
    if(mute) return;
    Clip c = clips.get(s);
    if(c == null) return;
    if(c.isRunning()) c.stop();
    c.setFramePosition(i);
    while(!c.isRunning()) c.start();
  }
 
  public static void stop(String s) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.