Examples of Clip


Examples of javax.sound.sampled.Clip

    public void testCreateAndPlayClip() throws Exception
    {
      InputStream bell = getClass().getResourceAsStream("Bell1_1s.wav");
      assertNotNull(bell);
      Clip clip = ClipBooster.createClip(bell);
      ClipBooster.playClipFromBeginning(clip, 1);
    }
View Full Code Here

Examples of javax.sound.sampled.Clip

   * @throws LineUnavailableException  forwarded from the underlying code
   * @throws UnsupportedAudioFileException  forwarded from the underlying code
   */
  public static Clip createClip(InputStream inputstream) throws IOException, LineUnavailableException, UnsupportedAudioFileException
  {
    Clip result = AudioSystem.getClip();
    result.open(AudioSystem.getAudioInputStream(inputstream));
    return result;
  }
View Full Code Here

Examples of javax.sound.sampled.Clip

    @Test
    public void testCreateAndPlayClip() throws Exception
    {
      InputStream bell = getClass().getResourceAsStream("Bell1_1s.wav");
      assertNotNull(bell);
      Clip clip = ClipBooster.createClip(bell);
      RunnableClip runnable = new RunnableClip(clip);
      ThreadBoostUtils.run(runnable, 1000);
      //ClipBooster.playClipFromBeginning(clip, 1);
    }
View Full Code Here

Examples of javax.sound.sampled.Clip

   * @throws LineUnavailableException  forwarded from the underlying code
   * @throws UnsupportedAudioFileException  forwarded from the underlying code
   */
  public static Clip createClip(InputStream inputstream) throws IOException, LineUnavailableException, UnsupportedAudioFileException
  {
    Clip result = AudioSystem.getClip();
    //add buffer for mark/reset support
    InputStream bufferedInput = new BufferedInputStream(inputstream);
   
    result.open(AudioSystem.getAudioInputStream(bufferedInput));
    return result;
  }
View Full Code Here

Examples of javax.sound.sampled.Clip

{

  public Clip createSampleClip() throws Exception {
    InputStream bell = getClass().getResourceAsStream("Bell1_1s.wav");
    assertNotNull(bell);
    Clip clip = AudioBoostUtils.createClip(bell);
    return clip;

  }
View Full Code Here

Examples of javax.sound.sampled.Clip

  }

    @Test
  public void testCreateClip() throws Exception
    {
    Clip clip = createSampleClip();
    assertNotNull(clip);
    }
View Full Code Here

Examples of javax.sound.sampled.Clip


    @Test
    public void testCreateAndPlayClip() throws Exception
    {
    Clip clip = new AudioBoostUtilsTest().createSampleClip();
      RunnableClip runnable = new RunnableClip(clip);
      ThreadBoostUtils.run(runnable, 1000);
    }
View Full Code Here

Examples of javax.sound.sampled.Clip

    void beep() {
        if (config.getBeep_alert()) {
            try {
                BufferedInputStream fileInStream = new BufferedInputStream(Client.class.getClassLoader().getResource("beep.wav").openStream());
                AudioInputStream beepStream = AudioSystem.getAudioInputStream(fileInStream);
                Clip c = AudioSystem.getClip();
                c.open(beepStream);
                c.start();
            } catch (Exception e) {
                logger.error(e.getMessage(), e);
            }
        }
    }
View Full Code Here

Examples of javax.sound.sampled.Clip

    public synchronized void playSound() {
        new Thread(new Runnable() {
            public void run() {
                try {
                    Clip clip = AudioSystem.getClip();
                    AudioInputStream effectStream = AudioSystem
                            .getAudioInputStream(new ByteArrayInputStream(
                                    GameManager.this.reactorEffectRawData));
                    clip.open(effectStream);
                    clip.start();
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
View Full Code Here

Examples of javax.sound.sampled.Clip

/* 145 */     if (this.ais == null)
/*     */     {
/* 150 */       return false;
/*     */     }
/*     */
/* 154 */     Clip leftLine = this.line;
/* 155 */     Clip rightLine = this.otherChannel;
/*     */
/* 170 */     double ZERO_EPS = 0.0039D;
/* 171 */     double leftVolume = leftGain;
/* 172 */     double rightVolume = rightGain;
/*     */
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.