public class IzouSoundDataLine extends IzouSoundLineBaseClass implements DataLine
DataLine.Info
isMutable, isMutedFromSystem, line, soundManager
log, main
Constructor and Description |
---|
IzouSoundDataLine(DataLine dataLine,
Main main,
boolean isPermanent,
AddOnModel addOnModel) |
Modifier and Type | Method and Description |
---|---|
int |
available()
Obtains the number of bytes of data currently available to the
application for processing in the data line's internal buffer.
|
void |
drain()
Drains queued data from the line by continuing data I/O until the
data line's internal buffer has been emptied.
|
void |
flush()
Flushes queued data from the line.
|
int |
getBufferSize()
Obtains the maximum number of bytes of data that will fit in the data line's
internal buffer.
|
AudioFormat |
getFormat()
Obtains the current format (encoding, sample rate, number of channels,
etc.) of the data line's audio data.
|
int |
getFramePosition()
Obtains the current position in the audio data, in sample frames.
|
float |
getLevel()
Obtains the current volume level for the line.
|
long |
getLongFramePosition()
Obtains the current position in the audio data, in sample frames.
|
long |
getMicrosecondPosition()
Obtains the current position in the audio data, in microseconds.
|
boolean |
isActive()
Indicates whether the line is engaging in active I/O (such as playback
or capture).
|
boolean |
isRunning()
Indicates whether the line is running.
|
void |
start()
Allows a line to engage in data I/O.
|
void |
stop()
Stops the line.
|
addLineListener, close, getAddOnModel, getControl, getControls, getLineInfo, getResponsibleID, isControlSupported, isMutedFromSystem, isMuteIfNonPermanent, isOpen, isPermanent, open, opening, removeLineListener, setMuteIfNonPermanent
debug, debug, error, error, fatal, fatal, getID, getMain
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLineListener, close, getControl, getControls, getLineInfo, isControlSupported, isOpen, open, removeLineListener
isOwner
public IzouSoundDataLine(DataLine dataLine, Main main, boolean isPermanent, AddOnModel addOnModel)
public void drain()
drain()
is invoked on a stopped line that has data in its queue, the method will
block until the line is running and the data queue becomes empty. If
drain()
is invoked by one thread, and another continues to
fill the data queue, the operation will not complete.
This method always returns when the data line is closed.public void flush()
public void start()
LineEvent.Type#START START
event is generated.start
in interface DataLine
stop()
,
isRunning()
public void stop()
flush
method.
When audio capture or playback stops, a LineEvent.Type#STOP STOP
event is generated.stop
in interface DataLine
start()
,
isRunning()
,
flush()
public boolean isRunning()
false
.
An open line begins running when the first data is presented in response to an
invocation of the start
method, and continues
until presentation ceases in response to a call to stop
or
because playback completes.public boolean isActive()
LineEvent.Type#START START
event to its listeners. Similarly, when
an active line becomes inactive, it sends a
LineEvent.Type#STOP STOP
event.isActive
in interface DataLine
true
if the line is actively capturing or rendering
sound, otherwise false
IzouSoundLineBaseClass.isOpen()
,
IzouSoundLineBaseClass.addLineListener(javax.sound.sampled.LineListener)
,
IzouSoundLineBaseClass.removeLineListener(javax.sound.sampled.LineListener)
public AudioFormat getFormat()
If the line is not open and has never been opened, it returns
the default format. The default format is an implementation
specific audio format, or, if the DataLine.Info
object, which was used to retrieve this DataLine
,
specifies at least one fully qualified audio format, the
last one will be used as the default format. Opening the
line with a specific audio format (e.g.
SourceDataLine#open(AudioFormat)) will override the
default format.
getFormat
in interface DataLine
AudioFormat
public int getBufferSize()
getBufferSize
in interface DataLine
public int available()
Note that the units used are bytes, but will always correspond to an integral number of sample frames of audio data.
An application is guaranteed that a read or
write operation of up to the number of bytes returned from
available()
will not block; however, there is no guarantee
that attempts to read or write more data will block.
public int getFramePosition()
getLongFramePosition
instead.getFramePosition
in interface DataLine
getLongFramePosition()
public long getLongFramePosition()
getLongFramePosition
in interface DataLine
public long getMicrosecondPosition()
getMicrosecondPosition
in interface DataLine
public float getLevel()
Copyright © 2016. All rights reserved.