Note that the naming convention for this interface reflects the relationship between the line and its mixer. From the perspective of an application, a source data line may act as a target for audio data.
A source data line can be obtained from a mixer by invoking the {@link Mixer#getLine getLine}
method of Mixer
with an appropriate {@link DataLine.Info}
object.
The SourceDataLine
interface provides a method for writing audio data to the data line's buffer. Applications that play or mix audio should write data to the source data line quickly enough to keep the buffer from underflowing (emptying), which could cause discontinuities in the audio that are perceived as clicks. Applications can use the {@link DataLine#available available}
method defined in the DataLine
interface to determine the amount of data currently queued in the data line's buffer. The amount of data which can be written to the buffer without blocking is the difference between the buffer size and the amount of queued data. If the delivery of audio output stops due to underflow, a {@link LineEvent.Type#STOP STOP}
event is generated. A {@link LineEvent.Type#START START}
event is generated when the audio output resumes.
@author Kara Kytle
@see Mixer
@see DataLine
@see TargetDataLine
@since 1.3
|
|
|
|