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

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.sound.sampled.DataLine
DataLine.Info
 
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
 
Methods inherited from interface javax.sound.sampled.Line
addLineListener, close, getControl, getControls, getLineInfo, isControlSupported, isOpen, open, removeLineListener
 

Method Detail

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 put
offset - the initial offset at which to write
length - the maximum number of bytes to read
Returns:
the actual number of bytes read