Package javax.sound.sampled

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


    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) {
    if(clips.get(s) == null) return;
    if(clips.get(s).isRunning()) clips.get(s).stop();
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 clp = AudioSystem.getClip();
              AudioInputStream inputStream = AudioSystem.getAudioInputStream(new FileInputStream(strURL));
              clp.open(inputStream);
              clp.start();
            } catch (Exception e) {
              System.err.println(e.getMessage());
            }
          }
        }).start();
View Full Code Here

            DataLine.Info info = new DataLine.Info(Clip.class, format);
            Clip clip = (Clip) AudioSystem.getLine(info);

            clip.open(stream);
            clip.start();
        } catch (UnsupportedAudioFileException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (LineUnavailableException e) {
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.