javax.sound.sampled
Interface SourceDataLine

All Superinterfaces:
DataLine, Line

public interface SourceDataLine
extends DataLine

This is a DataLine to which data may be written.

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, given the desired audio format.
 void open(AudioFormat fmt, int size)
          Open the line, given the desired audio format and the buffer size.
 int write(byte[] buf, int offset, int length)
          Write audio data to this line.
 
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, given the desired audio format.

Parameters:
fmt - the format to use
Throws:
LineUnavailableException - if the line is not available for some reason
SecurityException - if this is prevented by the security manager

open

void open(AudioFormat fmt,
          int size)
          throws LineUnavailableException
Open the line, given the desired audio format and the buffer size.

Parameters:
fmt - the format to use
size - the buffer size
Throws:
LineUnavailableException - if the line is not available for some reason
SecurityException - if this is prevented by the security manager

write

int write(byte[] buf,
          int offset,
          int length)
Write audio data to this line. The data must be an integral number of frames, as determined by the audio format.

Parameters:
buf - a byte array of audio data
offset - index of the first byte in the array to use
length - the number of bytes to write
Returns:
the number of bytes written