FIXME: Parameterize .. all configs .. best via an init-method, passing requested audio capabilities
| Modifier and Type | Field and Description |
|---|---|
| private SourceDataLine | |
| public static final int | |
| private int | |
| private AudioSink. | |
| private AudioFormat | |
| private DataLine. | |
| private boolean | |
| private volatile boolean | |
| private final byte[] | |
| public static final int | |
| private static final boolean | |
| private float |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | destroy()
Implements com. |
| public AudioSink. | enqueueData(final int pts, final ByteBuffer byteBuffer, final int byteCount)
Implements com. byteCount bytes of the remaining bytes of the given NIO ByteBuffer to this sink.
|
| public void | flush()
Implements com. pause().
|
| public final AudioSink. | getChosenFormat()
Implements com. AudioFormat as chosen by init(AudioFormat, float, int, int, int),
i.e. it shall match the requestedFormat.
|
| public final int | |
| public int | getFrameCount()
Implements com. init(AudioFormat, float, int, int, int).
|
| public int | getFreeFrameCount()
Implements com. |
| public final int | getMaxSupportedChannels()
Implements com. |
| public final float | getPlaySpeed()
Implements com. |
| public AudioSink. | getPreferredFormat()
Implements com. AudioFormat by this sink.
|
| public final int | getPTS()
Implements com. |
| public int | getQueuedByteCount()
Implements com. |
| public int | getQueuedFrameCount()
Implements com. |
| public int | getQueuedTime()
Implements com. |
| private final int | |
| public final float | |
| public boolean | init(final AudioSink.
the requested requestedFormat,AudioFormat.average or fixed frame duration in milliseconds
helping a caching frameDuration, final int AudioFrame based implementation to determine the frame count in the queue.
See DefaultFrameDuration.initial time in milliseconds to queue in this sink, see initialQueueSize, final int DefaultInitialQueueSize.time in milliseconds to grow queue if full, see queueGrowAmount, final int DefaultQueueGrowAmount.maximum time in milliseconds the queue can hold (and grow), see queueLimit)DefaultQueueLimitWithVideo and DefaultQueueLimitAudioOnly.Implements com. |
| public boolean | isInitialized()
Implements com. initialized state of this instance.
|
| public boolean | isPlaying()
Implements com. play() has been requested and the sink is still playing,
otherwise false.
|
| public final boolean | isSupported(final AudioSink.
Implements com. |
| public void | pause()
Implements com. |
| public void | play()
Implements com. enqueueData(AudioFrame) from current internal position.
|
| private void | |
| public final boolean | setPlaySpeed(final float rate)
Implements com. |
| public final boolean | setVolume(final float v)
Implements com. |
| public String |
| auline | back to summary |
|---|---|
| private SourceDataLine auline | |
| BUFFER_SIZE | back to summary |
|---|---|
| public static final int BUFFER_SIZE | |
| bufferCount | back to summary |
|---|---|
| private int bufferCount | |
| chosenFormat | back to summary |
|---|---|
| private AudioSink. | |
| format | back to summary |
|---|---|
| private AudioFormat format | |
| info | back to summary |
|---|---|
| private DataLine. | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| playRequested | back to summary |
|---|---|
| private volatile boolean playRequested | |
| sampleData | back to summary |
|---|---|
| private final byte[] sampleData | |
| SAMPLES_PER_BUFFER | back to summary |
|---|---|
| public static final int SAMPLES_PER_BUFFER | |
| staticAvailable | back to summary |
|---|---|
| private static final boolean staticAvailable | |
| volume | back to summary |
|---|---|
| private float volume | |
| JavaSoundAudioSink | back to summary |
|---|---|
| public JavaSoundAudioSink() | |
| destroy | back to summary |
|---|---|
| public void destroy() Implements com. Doc from com. Destroys this instance, i.e. closes all streams and devices allocated.
| |
| enqueueData | back to summary |
|---|---|
| public AudioSink. Implements com. Doc from com. Enqueue
The data must comply with the chosen
| |
| flush | back to summary |
|---|---|
| public void flush() Implements com. Doc from com. Flush all queued buffers, implies
| |
| getChosenFormat | back to summary |
|---|---|
| public final AudioSink. Implements com. Doc from com. Returns the
| |
| getEnqueuedFrameCount | back to summary |
|---|---|
| public final int getEnqueuedFrameCount() Implements com.
| |
| getFrameCount | back to summary |
|---|---|
| public int getFrameCount() Implements com. Doc from com. Returns the number of allocated buffers as requested by
| |
| getFreeFrameCount | back to summary |
|---|---|
| public int getFreeFrameCount() Implements com. Doc from com. Returns the current number of frames in the sink available for writing.
| |
| getMaxSupportedChannels | back to summary |
|---|---|
| public final int getMaxSupportedChannels() Implements com. Doc from com. Return the maximum number of supported channels.
| |
| getPlaySpeed | back to summary |
|---|---|
| public final float getPlaySpeed() Implements com. Doc from com. Returns the playback speed.
| |
| getPreferredFormat | back to summary |
|---|---|
| public AudioSink. Implements com. Doc from com. Returns the preferred The preferred format is guaranteed to be supported and shall reflect this sinks most native format, i.e. best performance w/o data conversion.
Known
| |
| getPTS | back to summary |
|---|---|
| public final int getPTS() Implements com. Doc from com. Return the current audio presentation timestamp (PTS) in milliseconds.
| |
| getQueuedByteCount | back to summary |
|---|---|
| public int getQueuedByteCount() Implements com. Doc from com. Returns the current number of bytes queued for playing.
| |
| getQueuedFrameCount | back to summary |
|---|---|
| public int getQueuedFrameCount() Implements com. Doc from com. Returns the current number of frames queued for playing.
| |
| getQueuedTime | back to summary |
|---|---|
| public int getQueuedTime() Implements com. Doc from com. Returns the current queued frame time in milliseconds for playing.
| |
| getQueuedTimeImpl | back to summary |
|---|---|
| private final int getQueuedTimeImpl(final int byteCount) | |
| getVolume | back to summary |
|---|---|
| public final float getVolume() Implements com. Doc from com. Returns the volume.
| |
| init | back to summary |
|---|---|
| public boolean init(final AudioSink. Implements com. Doc from com. Initializes the sink.
Implementation must match the given
Caller shall validate
| |
| isInitialized | back to summary |
|---|---|
| public boolean isInitialized() Implements com. Doc from com. Returns the
The
| |
| isPlaying | back to summary |
|---|---|
| public boolean isPlaying() Implements com. Doc from com. Returns true, if
| |
| isSupported | back to summary |
|---|---|
| public final boolean isSupported(final AudioSink. Implements com. Doc from com. Returns true if the given format is supported by the sink, otherwise false.
| |
| pause | back to summary |
|---|---|
| public void pause() Implements com. Doc from com. Pause playing buffers while keeping enqueued data incl. it's internal position.
| |
| play | back to summary |
|---|---|
| public void play() Implements com. Doc from com. Play buffers queued via
| |
| playImpl | back to summary |
|---|---|
| private void playImpl() | |
| setPlaySpeed | back to summary |
|---|---|
| public final boolean setPlaySpeed(final float rate) Implements com. Doc from com. Sets the playback speed. To simplify test, play speed is normalized, i.e.
| |
| setVolume | back to summary |
|---|---|
| public final boolean setVolume(final float v) Implements com. Doc from com. Sets the volume [0f..1f]. To simplify test, volume is normalized, i.e.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |