javax.sound.sampled
Interface TargetDataLine
- All Superinterfaces:
- DataLine, Line
public interface TargetDataLine
- extends DataLine
This is a DataLine from which data may be read.
- Since:
- 1.3
Method Summary |
void |
open(AudioFormat fmt)
Open the line using the indicated audio format. |
void |
open(AudioFormat fmt,
int size)
Open the line using the indicated audio format and buffer size. |
int |
read(byte[] buf,
int offset,
int length)
Read data from the line into the given buffer. |
Methods inherited from interface javax.sound.sampled.DataLine |
available, drain, flush, getBufferSize, getFormat, getFramePosition, getLevel, getLongFramePosition, getMicrosecondPosition, isActive, isRunning, start, stop |
open
void open(AudioFormat fmt)
throws LineUnavailableException
- 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
void open(AudioFormat fmt,
int size)
throws LineUnavailableException
- 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
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 putoffset
- the initial offset at which to writelength
- the maximum number of bytes to read
- Returns:
- the actual number of bytes read