Package javax.sound.sampled

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


                numBytesRead = sourceBis.read(buffer, 0, buffer.length);
                if (numBytesRead != -1) {
                    line.write(buffer, 0, numBytesRead);
                }
            }
            line.drain();
            line.close();

        } catch (UnsupportedAudioFileException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
View Full Code Here


     * Line.
     */
    protected void threadStopped() {
        SourceDataLine line = (SourceDataLine) localLine.get();
        if (line != null) {
            line.drain();
            line.close();
        }
    }

    /**
 
View Full Code Here

                e.printStackTrace();
            }

            System.out.println("Play.playAudioStream draining line.");
            // Continues data line I/O until its buffer is drained.
            dataLine.drain();

            System.out.println("Play.playAudioStream closing line.");
            // Closes the data line, freeing any resources such as the audio device.
            dataLine.close();
        }
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.