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
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 |
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 usesize
- 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 dataoffset
- index of the first byte in the array to uselength
- the number of bytes to write
- Returns:
- the number of bytes written