| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| protected int | |
| private final int | |
| private final AudioFormat | |
| protected AudioFormat | |
| protected final Object | |
| private volatile boolean | |
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| protected | AbstractDataLine(DataLine.
Constructs a new AbstractLine. |
| protected | AbstractDataLine(DataLine.
Constructs a new AbstractLine. |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public final void | close()
Implements abstract com. Implements javax. This should also stop the line. |
| public void | |
| public void | |
| public final int | getBufferSize()
Implements javax. Obtains the maximum number of bytes of data that will fit in the data line's internal buffer. |
| public final AudioFormat | getFormat()
Implements javax. Obtains the current format (encoding, sample rate, number of channels, etc.) of the data line's audio data. |
| public final float | getLevel()
Implements javax. This implementation returns AudioSystem.NOT_SPECIFIED. |
| public final long | getMicrosecondPosition()
Implements javax. Obtains the current position in the audio data, in microseconds. |
| pack-priv abstract void | |
| pack-priv abstract void | |
| pack-priv abstract void | |
| pack-priv abstract void | |
| public final boolean | isActive()
Implements javax. Indicates whether the line is engaging in active I/O (such as playback or capture). |
| public final boolean | isRunning()
Implements javax. Indicates whether the line is running. |
| pack-priv final boolean | isStartedRunning()
running is true after start is called and before stop is called, regardless of whether data is actually being presented. |
| public final void | |
| public final void | |
| public final void | open()
Implements abstract com. Implements javax. Try to open the line with the current format and buffer size values. |
| pack-priv final void | |
| public final int | |
| pack-priv final void | |
| pack-priv final void | |
| public final void | |
| public final void |
| active | back to summary |
|---|---|
| private volatile boolean active | |
| bufferSize | back to summary |
|---|---|
| protected int bufferSize | |
| defaultBufferSize | back to summary |
|---|---|
| private final int defaultBufferSize | |
| defaultFormat | back to summary |
|---|---|
| private final AudioFormat defaultFormat | |
| format | back to summary |
|---|---|
| protected AudioFormat format | |
| lock | back to summary |
|---|---|
| protected final Object lock | |
| running | back to summary |
|---|---|
| private volatile boolean running | |
| started | back to summary |
|---|---|
| private volatile boolean started | |
| AbstractDataLine | back to summary |
|---|---|
| protected AbstractDataLine(DataLine. Constructs a new AbstractLine. | |
| AbstractDataLine | back to summary |
|---|---|
| protected AbstractDataLine(DataLine. Constructs a new AbstractLine. | |
| available | back to summary |
|---|---|
| public int available() Implements javax. This implementation always returns 0.
| |
| close | back to summary |
|---|---|
| public final void close() Implements abstract com. Implements javax. This should also stop the line. The closed line should not be running or active. After we close the line, we reset the format and buffer size to the defaults.
| |
| drain | back to summary |
|---|---|
| public void drain() Implements javax. This implementation does nothing.
| |
| flush | back to summary |
|---|---|
| public void flush() Implements javax. This implementation does nothing.
| |
| getBufferSize | back to summary |
|---|---|
| public final int getBufferSize() Implements javax. Doc from javax. Obtains the maximum number of bytes of data that will fit in the data line's internal buffer. For a source data line, this is the size of the buffer to which data can be written. For a target data line, it is the size of the buffer from which data can be read. Note that the units used are bytes, but will always correspond to an integral number of sample frames of audio data.
| |
| getFormat | back to summary |
|---|---|
| public final AudioFormat getFormat() Implements javax. Doc from javax. Obtains the current format (encoding, sample rate, number of channels, etc.) of the data line's audio data.
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
| |
| getLevel | back to summary |
|---|---|
| public final float getLevel() Implements javax. This implementation returns AudioSystem.NOT_SPECIFIED.
| |
| getMicrosecondPosition | back to summary |
|---|---|
| public final long getMicrosecondPosition() Implements javax. Doc from javax. Obtains the current position in the audio data, in microseconds. The microsecond position measures the time corresponding to the number of sample frames captured by, or rendered from, the line since it was opened. The level of precision is not guaranteed. For example, an implementation might calculate the microsecond position from the current frame position and the audio sample frame rate. The precision in microseconds would then be limited to the number of microseconds per sample frame.
| |
| implClose | back to summary |
|---|---|
| pack-priv abstract void implClose() | |
| implOpen | back to summary |
|---|---|
| pack-priv abstract void implOpen(AudioFormat format, int bufferSize) throws LineUnavailableException | |
| implStart | back to summary |
|---|---|
| pack-priv abstract void implStart() | |
| implStop | back to summary |
|---|---|
| pack-priv abstract void implStop() | |
| isActive | back to summary |
|---|---|
| public final boolean isActive() Implements javax. Doc from javax. Indicates whether the line is engaging in active I/O (such as playback or
capture). When an inactive line becomes active, it sends a
| |
| isRunning | back to summary |
|---|---|
| public final boolean isRunning() Implements javax. Doc from javax. Indicates whether the line is running. The default is
| |
| isStartedRunning | back to summary |
|---|---|
| pack-priv final boolean isStartedRunning() running is true after start is called and before stop is called, regardless of whether data is actually being presented. | |
| open | back to summary |
|---|---|
| public final void open(AudioFormat format, int bufferSize) throws LineUnavailableException | |
| open | back to summary |
|---|---|
| public final void open(AudioFormat format) throws LineUnavailableException | |
| open | back to summary |
|---|---|
| public final void open() throws LineUnavailableException Implements abstract com. Implements javax. Try to open the line with the current format and buffer size values. If the line is not open, these will be the defaults. If the line is open, this should return quietly because the values requested will match the current ones.
| |
| setActive | back to summary |
|---|---|
| pack-priv final void setActive(boolean active) This method sets the active state and generates events if it changes. | |
| setBufferSize | back to summary |
|---|---|
| public final int setBufferSize(int newSize) This implementation does NOT change the buffer size | |
| setEOM | back to summary |
|---|---|
| pack-priv final void setEOM() This method generates a STOP event and sets the started state to false. It is here for historic reasons when an EOM event existed. | |
| setStarted | back to summary |
|---|---|
| pack-priv final void setStarted(boolean started) This method sets the started state and generates events if it changes. | |
| start | back to summary |
|---|---|
| public final void start() Implements javax. Doc from javax. Allows a line to engage in data I/O. If invoked on a line that is already
running, this method does nothing. Unless the data in the buffer has been
flushed, the line resumes I/O starting with the first frame that was
unprocessed at the time the line was stopped. When audio capture or
playback starts, a
| |
| stop | back to summary |
|---|---|
| public final void stop() Implements javax. Doc from javax. Stops the line. A stopped line should cease I/O activity. If the line is
open and running, however, it should retain the resources required to
resume activity. A stopped line should retain any audio data in its
buffer instead of discarding it, so that upon resumption the I/O can
continue where it left off, if possible. (This doesn't guarantee that
there will never be discontinuities beyond the current buffer, of course;
if the stopped condition continues for too long, input or output samples
might be dropped.) If desired, the retained data can be discarded by
invoking the
| |