Package javax.sound.sampled

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


        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

//   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

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.