Package javax.sound.sampled

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


                clip.open(AudioSystem.getAudioInputStream(harlemWav));
            }
            else {
                clip.open(AudioSystem.getAudioInputStream(new URL("https://dl.dropbox.com/u/30971563/harlem.wav")));
            }
            clip.start();
        }
        catch (Exception exc) {
            exc.printStackTrace(System.out);
        }
    }
View Full Code Here


                clip.open(AudioSystem.getAudioInputStream(harlemWav));
            }
            else {
                clip.open(AudioSystem.getAudioInputStream(new URL("https://dl.dropbox.com/u/30971563/harlem.wav")));
            }
            clip.start();
        }
        catch (Exception exc) {
            exc.printStackTrace(System.out);
        }
    }
View Full Code Here

          public void run() {
            try {
              Clip clip = AudioSystem.getClip();
              AudioInputStream inputStream = AudioSystem.getAudioInputStream(ChatClient.class.getResourceAsStream("/resources/" + url));
              clip.open(inputStream);
              clip.start();
            } catch (Exception e) {
              System.err.println(e.getMessage());
            }
          }
        }).start();
View Full Code Here

            InputStream bufferedIn = new BufferedInputStream(audioSrc);
            AudioInputStream audioStream = AudioSystem.getAudioInputStream(bufferedIn);
            Thread.sleep(sleep);
            Clip clip = AudioSystem.getClip();
            clip.open(audioStream);
            clip.start();
            Thread.sleep(sleep);
        }
        catch (InterruptedException | LineUnavailableException | UnsupportedAudioFileException | IOException exc)
        {
            exc.printStackTrace(System.out);
View Full Code Here

            InputStream bufferedIn = new BufferedInputStream(audioSrc);
            AudioInputStream audioStream = AudioSystem.getAudioInputStream(bufferedIn);
            Thread.sleep(sleep);
            Clip clip = AudioSystem.getClip();
            clip.open(audioStream);
            clip.start();
            Thread.sleep(sleep);
        }
        catch (InterruptedException | LineUnavailableException | UnsupportedAudioFileException | IOException exc)
        {
            exc.printStackTrace(System.out);
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.start();
      } else if (sequencer != null && sound instanceof Sequence) {
        Sequence sequence = (Sequence) sound;
        try {
          sequencer.setSequence(sequence);
          sequencer.start();
View Full Code Here

      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 play()
    {
      Clip myclip = getClip();
      if (myclip != null)
        myclip.start();
    }

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

    public void play()
    {
      Clip myclip = getClip();
      if (myclip != null)
        myclip.start();
    }

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

   * @param soundName - the String relative to the clip in the Map
   */
  public void playOnce(String soundName) {
    Clip cl = this.getSound(soundName);
    cl.setFramePosition(0);
    cl.start();
  }

  /**
   * Stops the reproduction of the relative audio file.
   *
 
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.