javax.sound.sampled

Interface TargetDataLine

public interface TargetDataLine extends DataLine

This is a DataLine from which data may be read.

Since: 1.3

Method Summary
voidopen(AudioFormat fmt)
Open the line using the indicated audio format.
voidopen(AudioFormat fmt, int size)
Open the line using the indicated audio format and buffer size.
intread(byte[] buf, int offset, int length)
Read data from the line into the given buffer.

Method Detail

open

public void open(AudioFormat fmt)
Open the line using the indicated audio format.

Parameters: fmt the format to use

Throws: LineUnavailableException if the line is not available for some reason SecurityException if this operation is prevented by the security manager

open

public void open(AudioFormat fmt, int size)
Open the line using the indicated audio format and buffer size.

Parameters: fmt the format to use

Throws: LineUnavailableException if the line is not available for some reason SecurityException if this operation is prevented by the security manager

read

public int read(byte[] buf, int offset, int length)
Read data from the line into the given buffer. The requested data should be an integral number of framaes, as determined by the audio format.

Parameters: buf the buffer into which the data is put offset the initial offset at which to write length the maximum number of bytes to read

Returns: the actual number of bytes read