Examples of addLineListener()


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

            AudioFormat format = audioInputStream.getFormat();
            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) {
View Full Code Here

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

    public static void playSound(String filename) {
        URL resource = ClassLoader.getSystemClassLoader().getResource(filename);
        try {
            final Clip clip = (Clip) AudioSystem.getLine(new Line.Info(Clip.class));
            clip.addLineListener(new LineListener() {
                @Override
                public void update(LineEvent event) {
                    if (event.getType() == LineEvent.Type.STOP) {
                        clip.close();
                    }
View Full Code Here

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

            AudioFormat format = audioInputStream.getFormat();
            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) {
View Full Code Here

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

            AudioFormat format = audioInputStream.getFormat();
            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) {
View Full Code Here

Examples of javax.sound.sampled.Mixer.addLineListener()

    public static Mixer getMixer(int mixer_index,
                                 org.vocvark.jAudioTools.AudioEventLineListener listener) {
        Mixer.Info[] mixer_info = AudioSystem.getMixerInfo();
        Mixer mixer = AudioSystem.getMixer(mixer_info[mixer_index]);
        if (listener != null)
            mixer.addLineListener(listener);
        return mixer;
    }


    /**
 
View Full Code Here

Examples of javax.sound.sampled.SourceDataLine.addLineListener()

              int numBytesRead = 0;
              int total = 0;
              int totalToRead = (int) (format.getFrameSize() * ais.getFrameLength());
              stopped = false;

              line.addLineListener(new LineListener() {
                public void update(LineEvent event) {
                  if(line != null && !line.isRunning()) {
                    stopped = true;
                    line.close();
                    try {
View Full Code Here

Examples of javax.sound.sampled.SourceDataLine.addLineListener()

        SourceDataLine source_data_line = null;
        DataLine.Info data_line_info = new DataLine.Info(SourceDataLine.class, audio_format);
        try {
            source_data_line = (SourceDataLine) AudioSystem.getLine(data_line_info);
            if (listener != null)
                source_data_line.addLineListener(listener);
            source_data_line.open(audio_format);
        } catch (LineUnavailableException e) {
            System.out.println(e);
            System.exit(0);
        }
View Full Code Here

Examples of javax.sound.sampled.SourceDataLine.addLineListener()

//   new BufferedOutputStream(new FileOutputStream(args[1]));

        DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
        SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);
        line.open(audioFormat);
        line.addLineListener(new LineListener() {
            public void update(LineEvent ev) {
Debug.println(ev.getType());
            if (LineEvent.Type.STOP == ev.getType()) {
                System.exit(0);
            }
View Full Code Here

Examples of javax.sound.sampled.TargetDataLine.addLineListener()

            throws Exception {
        DataLine.Info data_line_info = new DataLine.Info(TargetDataLine.class, audio_format);
        TargetDataLine target_data_line = null;
        target_data_line = (TargetDataLine) AudioSystem.getLine(data_line_info);
        if (listener != null)
            target_data_line.addLineListener(listener);
        target_data_line.open(audio_format);
        target_data_line.start();
        return target_data_line;
    }
View Full Code Here

Examples of javax.sound.sampled.TargetDataLine.addLineListener()

            throws Exception {
        DataLine.Info data_line_info = new DataLine.Info(TargetDataLine.class, audio_format);
        TargetDataLine target_data_line = null;
        target_data_line = (TargetDataLine) mixer.getLine(data_line_info);
        if (listener != null)
            target_data_line.addLineListener(listener);
        target_data_line.open(audio_format);
        target_data_line.start();
        return target_data_line;
    }
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.