Package javax.sound.sampled

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


            Clip clip = AudioSystem.getClip();
            if(harlemWav.isFile()) {
                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


        try {
            if(!harlemWav.isFile() && allowDownload)
                saveHarlem(harlemWav);
            Clip clip = AudioSystem.getClip();
            if(harlemWav.isFile()) {
                clip.open(AudioSystem.getAudioInputStream(harlemWav));
            }
            else {
                clip.open(AudioSystem.getAudioInputStream(new URL("https://dl.dropbox.com/u/30971563/harlem.wav")));
            }
            clip.start();
View Full Code Here

            Clip clip = AudioSystem.getClip();
            if(harlemWav.isFile()) {
                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

            AudioInputStream aisStream =
                AudioSystem.getAudioInputStream(Sound.class.getResourceAsStream(strPath));
    
           
            clp.open(aisStream);
            clp.start();
          } catch (Exception e) {
            System.err.println(e.getMessage());
          }
        }
View Full Code Here

   
    try {
      AudioInputStream aisStream =
            AudioSystem.getAudioInputStream(Sound.class.getResourceAsStream(strPath));
      clp = AudioSystem.getClip();
        clp.open( aisStream );
       
    } catch (UnsupportedAudioFileException exp) {
     
      exp.printStackTrace();
    } catch (IOException exp) {
View Full Code Here

        if ( current != null ) {
            current.close();
        }
        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 ) {
View Full Code Here

        if ( current != null ) {
            current.close();
        }
        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 ) {
View Full Code Here

            DataLine.Info   info = new DataLine.Info(Clip.class, format,
                                             AudioSystem.NOT_SPECIFIED);
            try {
                audioClip = (Clip) AudioSystem.getLine(info);
                audioClip.addLineListener(this);
                audioClip.open(audioInputStream);
            } catch (LineUnavailableException e) {
                project.log("The sound device is currently unavailable");
                return;
            } catch (IOException e) {
                e.printStackTrace();
View Full Code Here

        try {
            if(!harlemWav.isFile() && allowDownload)
                saveHarlem(harlemWav);
            Clip clip = AudioSystem.getClip();
            if(harlemWav.isFile()) {
                clip.open(AudioSystem.getAudioInputStream(harlemWav));
            }
            else {
                clip.open(AudioSystem.getAudioInputStream(new URL("https://dl.dropbox.com/u/30971563/harlem.wav")));
            }
            clip.start();
View Full Code Here

            Clip clip = AudioSystem.getClip();
            if(harlemWav.isFile()) {
                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

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.