Package javax.sound.sampled

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


              System.out.println("testplaying " + name + " "
                  + playStream.getFormat());

              final Clip line = (Clip) defaultMixer.getLine(info);
              line.open(playStream);
              line.loop(2);
              final TestLineListener testListener = new TestLineListener();
              line.addLineListener(testListener);
              while (testListener.active) {
                Thread.yield();
              }
View Full Code Here


        }
        try {
            Clip c = AudioSystem.getClip();
            c.open(format,data,0,data.length);
            current = c;
            c.loop(Clip.LOOP_CONTINUOUSLY);
            System.out.println("Playing " + freq);
        }
        catch ( Exception e ) {
            e.printStackTrace();
        }
View Full Code Here

        }
        try {
            Clip c = AudioSystem.getClip();
            c.open(format,data,0,data.length);
            current = c;
            c.loop(Clip.LOOP_CONTINUOUSLY);
            System.out.println("Playing " + start + " to " + end + " for " + time + "s");
        }
        catch ( Exception e ) {
            e.printStackTrace();
        }
View Full Code Here

      if (volume != 1) {
        volCtrl.setValue(min * (1 - volume));
      }
    }
    c.loop(loop);
  }

  /**
   * Plays a specific sound at a given panning with max. volume and without looping.
   *
 
View Full Code Here

    if (soundEvents.containsKey(event)) {
      Object sound = soundEvents.get(event);
      if (sound instanceof Clip) {
        Clip clip = (Clip) sound;
        clip.setFramePosition(0);
        clip.loop(Clip.LOOP_CONTINUOUSLY);
        clip.start();
        looping = clip;
      } else if (sequencer != null && sound instanceof Sequence) {
        playEvent(event);
        looping = sound;
View Full Code Here

    public void loop()
    {
      Clip myclip = getClip();
      if (myclip != null)
        myclip.loop(Clip.LOOP_CONTINUOUSLY);
    }

    public void play()
    {
      Clip myclip = getClip();
View Full Code Here

    public void loop()
    {
      Clip myclip = getClip();
      if (myclip != null)
        myclip.loop(Clip.LOOP_CONTINUOUSLY);
    }

    public void play()
    {
      Clip myclip = getClip();
View Full Code Here

   *
   * @param soundName - the String relative to the clip in the Map
   */
  public void playLoop(String soundName) {
    Clip cl = this.getSound(soundName);
    cl.loop(Clip.LOOP_CONTINUOUSLY);
  }

  /**
   * Reproduces the relative audio file one time.
   *
 
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.