Package javax.sound.sampled

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


        } else if (curPosition == Position.LEFT) {
          pan.setValue(-1.0f);
        }
      }

      auline.start();

      int nBytesRead = 0;
      byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];

      while (nBytesRead != -1) {
View Full Code Here


        pan.setValue(1.0f);
      else if (curPosition == Position.LEFT)
        pan.setValue(-1.0f);
    }
    auline.start();
    int nBytesRead = 0;
    byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];
    try {
      while (nBytesRead != -1) {
View Full Code Here

            } else if (curPosition == Position.LEFT) {
                pan.setValue(-1.0f);
            }
        }

        auline.start();
        int nBytesRead = 0;
        byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];

        try {
            while (nBytesRead != -1) {
View Full Code Here

              AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File(audioURL.getFile()));
              AudioFormat format = audioInputStream.getFormat();
              DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
              SourceDataLine auline = (SourceDataLine) AudioSystem.getLine(info);
              auline.open(format);
              auline.start();
              int nBytesRead = 0;
              byte[] abData = new byte[524288];

              while (nBytesRead != -1) {
                nBytesRead = audioInputStream.read(abData, 0, abData.length);
View Full Code Here

              AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File(audioURL.getFile()));
              AudioFormat format = audioInputStream.getFormat();
              DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
              SourceDataLine auline = (SourceDataLine) AudioSystem.getLine(info);
              auline.open(format);
              auline.start();
              int nBytesRead = 0;
              byte[] abData = new byte[524288];

              while (nBytesRead != -1) {
                nBytesRead = audioInputStream.read(abData, 0, abData.length);
View Full Code Here

              AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File(audioURL.getFile()));
              AudioFormat format = audioInputStream.getFormat();
              DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
              SourceDataLine auline = (SourceDataLine) AudioSystem.getLine(info);
              auline.open(format);
              auline.start();
              int nBytesRead = 0;
              byte[] abData = new byte[524288];

              while (nBytesRead != -1) {
                nBytesRead = audioInputStream.read(abData, 0, abData.length);
View Full Code Here

                        log.error("unknowen error while playing sound:"
                            + fileName, e);
                        return;
                    }

                    auline.start();
                    int nBytesRead = 0;
                    byte[] abData = new byte[EXTERNAL_BUFFER_SIZE];

                    try {
                        while (nBytesRead != -1) {
View Full Code Here

    try {
    AudioFormat af = new AudioFormat(SAMPLE_RATE, 8, 1, true, false);
    sdl = AudioSystem.getSourceDataLine(af);
    sdl = AudioSystem.getSourceDataLine(af);
    sdl.open(af);
    sdl.start();
    for (int i = 0; i < (int)SAMPLE_RATE; ++i) {
      double angle = i / (SAMPLE_RATE / 440) * 2.0 * Math.PI;
      buf[0] = (byte) (Math.sin(angle) * 128);
      sdl.write(buf, 0, 1);
    }
View Full Code Here

            SourceDataLine line = AudioSystem.getSourceDataLine(af);

            line.open(af);
            int bufSize = line.getBufferSize();

            line.start();

            byte[] data = new byte[bufSize];
            int bytesRead;

            while ((bytesRead = ais.read(data,0,data.length)) != -1) {
View Full Code Here

        }

        // -- open the source data line (the output line) --
        dataLine = (SourceDataLine) AudioSystem.getLine( outInfo );
        dataLine.open( format, 50000 );
        dataLine.start();
        return dataLine;
    }
}
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.