Package javax.sound.sampled

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


            int bufferSize = format.getFrameSize() * Math.round(format.getSampleRate() / 10);
            byte[] buffer = new byte[bufferSize];
            DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
            SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);
            line.open(format, buffer.length);
            line.start();

            int numBytesRead = 0;
            while (numBytesRead != -1) {
                numBytesRead = sourceBis.read(buffer, 0, buffer.length);
                if (numBytesRead != -1) {
View Full Code Here


            // the line is unavailable - signal to end this thread
            Thread.currentThread().interrupt();
            return;
        }

        line.start();

        // create the buffer
        byte[] buffer = new byte[bufferSize];

        // set this thread's locals
View Full Code Here

                FloatControl volume = (FloatControl) dataLine.getControl(FloatControl.Type.MASTER_GAIN);
                volume.setValue(100.0F);
            }

            // Allows the line to move data in and out to a port.
            dataLine.start();

            // Create a buffer for moving data from the audio stream to the line.  
            int bufferSize = (int) audioFormat.getSampleRate() * audioFormat.getFrameSize();
            byte[] buffer = new byte[bufferSize];

View Full Code Here

        line = (SourceDataLine) AudioSystem.getLine(info);

        // open the line and start the line

        line.open(audioFormat);
        line.start();
        mAudioLines.put(streamIndex, line);

        // if mDataLine is not yet defined, do so

        if (null == mDataLine)
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.