| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | AudioSink.
Specifies the linear audio PCM format. |
| public abstract static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final boolean | |
| public static final AudioSink. | DefaultFormat
Default |
| public static final int | DefaultFrameDuration
Default frame duration in millisecond, i.e. 1 frame per ms. |
| public static final int | DefaultInitialQueueSize
Initial audio queue size in milliseconds. |
| public static final int | DefaultQueueGrowAmount
Audio queue grow size in milliseconds. |
| public static final int | DefaultQueueLimitAudioOnly
Audio queue limit w/o video in milliseconds. |
| public static final int | DefaultQueueLimitWithVideo
Audio queue limit w/ video in milliseconds. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public AudioSink. | Returns: the enqueued internalAudioFrame.Enqueue |
| public void | |
| public AudioSink. | getChosenFormat()
Returns the |
| public int | Returns: the current enqueued frames count sinceinit(AudioFormat, float, int, int, int).
|
| public int | getFrameCount()
Returns the number of allocated buffers as requested by
|
| public int | |
| public int | |
| public float | |
| public AudioSink. | |
| public int | |
| public int | |
| public int | |
| public int | |
| public float | |
| public boolean | Returns: true if successful, otherwise falsethe requested requestedFormat,AudioFormat.average or fixed frame duration in milliseconds
helping a caching frameDuration, 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, int DefaultInitialQueueSize.time in milliseconds to grow queue if full, see queueGrowAmount, int DefaultQueueGrowAmount.maximum time in milliseconds the queue can hold (and grow), see queueLimit)DefaultQueueLimitWithVideo and DefaultQueueLimitAudioOnly.Initializes the sink. |
| public boolean | |
| public boolean | |
| public boolean | isSupported(AudioSink.
Returns true if the given format is supported by the sink, otherwise false. |
| public void | |
| public void | |
| public boolean | Returns: true if successful, otherwise false, i.e. due to unsupported value range of implementation.Sets the playback speed. |
| public boolean | Returns: true if successful, otherwise false, i.e. due to unsupported value range of implementation.Sets the volume [0f..1f]. |
| DEBUG | back to summary |
|---|---|
| public static final boolean DEBUG | |
| DefaultFormat | back to summary |
|---|---|
| public static final AudioSink. Default | |
| DefaultFrameDuration | back to summary |
|---|---|
| public static final int DefaultFrameDuration Default frame duration in millisecond, i.e. 1 frame per ms. | |
| DefaultInitialQueueSize | back to summary |
|---|---|
| public static final int DefaultInitialQueueSize Initial audio queue size in milliseconds. ms, i.e. 16 frames per 32 ms. See | |
| DefaultQueueGrowAmount | back to summary |
|---|---|
| public static final int DefaultQueueGrowAmount Audio queue grow size in milliseconds. ms, i.e. 16 frames per 32 ms. See | |
| DefaultQueueLimitAudioOnly | back to summary |
|---|---|
| public static final int DefaultQueueLimitAudioOnly Audio queue limit w/o video in milliseconds. ms, i.e. 32 frames per 32 ms. See | |
| DefaultQueueLimitWithVideo | back to summary |
|---|---|
| public static final int DefaultQueueLimitWithVideo Audio queue limit w/ video in milliseconds. ms, i.e. 96 frames per 32 ms. See | |
| destroy | back to summary |
|---|---|
| public void destroy() Destroys this instance, i.e. closes all streams and devices allocated. | |
| enqueueData | back to summary |
|---|---|
| public AudioSink. Enqueue
The data must comply with the chosen
| |
| flush | back to summary |
|---|---|
| public void flush() Flush all queued buffers, implies
| |
| getChosenFormat | back to summary |
|---|---|
| public AudioSink. Returns the | |
| getEnqueuedFrameCount | back to summary |
|---|---|
public int getEnqueuedFrameCount()
| |
| getFrameCount | back to summary |
|---|---|
| public int getFrameCount() Returns the number of allocated buffers as requested by
| |
| getFreeFrameCount | back to summary |
|---|---|
| public int getFreeFrameCount() Returns the current number of frames in the sink available for writing.
| |
| getMaxSupportedChannels | back to summary |
|---|---|
| public int getMaxSupportedChannels() Return the maximum number of supported channels. | |
| getPlaySpeed | back to summary |
|---|---|
| public float getPlaySpeed() Returns the playback speed. | |
| getPreferredFormat | back to summary |
|---|---|
| public AudioSink. 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 int getPTS() Return the current audio presentation timestamp (PTS) in milliseconds. | |
| getQueuedByteCount | back to summary |
|---|---|
| public int getQueuedByteCount() Returns the current number of bytes queued for playing.
| |
| getQueuedFrameCount | back to summary |
|---|---|
| public int getQueuedFrameCount() Returns the current number of frames queued for playing.
| |
| getQueuedTime | back to summary |
|---|---|
| public int getQueuedTime() Returns the current queued frame time in milliseconds for playing.
| |
| getVolume | back to summary |
|---|---|
| public float getVolume() Returns the volume. | |
| init | back to summary |
|---|---|
| public boolean init(AudioSink. Initializes the sink.
Implementation must match the given
Caller shall validate
| |
| isInitialized | back to summary |
|---|---|
| public boolean isInitialized() Returns the
The | |
| isPlaying | back to summary |
|---|---|
| public boolean isPlaying() Returns true, if | |
| isSupported | back to summary |
|---|---|
| public boolean isSupported(AudioSink. Returns true if the given format is supported by the sink, otherwise false.
| |
| pause | back to summary |
|---|---|
| public void pause() Pause playing buffers while keeping enqueued data incl. it's internal position.
| |
| play | back to summary |
|---|---|
| public void play() Play buffers queued via
| |
| setPlaySpeed | back to summary |
|---|---|
| public boolean setPlaySpeed(float s) Sets the playback speed. To simplify test, play speed is normalized, i.e.
| |
| setVolume | back to summary |
|---|---|
| public boolean setVolume(float v) Sets the volume [0f..1f]. To simplify test, volume is normalized, i.e.
| |
| Modifier and Type | Field and Description |
|---|---|
| protected final ByteBuffer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final ByteBuffer | |
| public String | toString()
Overrides com. |
| data | back to summary |
|---|---|
| protected final ByteBuffer data | |
| AudioDataFrame | back to summary |
|---|---|
| public AudioDataFrame(final int pts, final int duration, final ByteBuffer bytes, final int byteCount) | |
| getData | back to summary |
|---|---|
| public final ByteBuffer getData() Get this frame's data. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| public final int | channelCount
Number of channels. |
| public final boolean | fixedP
Fixed or floating point values. |
| public final boolean | |
| public final boolean | planar
Planar or packed samples. |
| public final int | sampleRate
Sample rate in Hz (1/s). |
| public final int | sampleSize
Sample size in bits. |
| public final boolean |
| Access | Constructor and Description |
|---|---|
| public | AudioFormat(final int
sample rate in Hz (1/s) sampleRate, final int sample size in bits sampleSize, final int number of channels channelCount, final boolean true if signed number, false for unsigned signed, final boolean true for fixed point value, false for unsigned floating point value with a sampleSize of 32 (float) or 64 (double) fixedP, final boolean true for planar data package (each channel in own data buffer), false for packed data channels interleaved in one buffer. planar, final boolean true for little-endian, false for big endian littleEndian)
|
| Modifier and Type | Method and Description |
|---|---|
| public final int | getBytesDuration(final int byteCount)
Returns the duration in milliseconds of the given byte count
according to |
| public final int | getBytesSampleCount(final int
number of bytes byteCount)Returns the sample count of given byte count
according to the ( byteCount * 8 ) / sampleSize |
| public final int | getDurationsByteSize(final int millisecs)
Returns the byte size of the given milliseconds
according to |
| public final int | getFrameCount(final int
time in milliseconds millisecs, final float duration per frame in milliseconds. frameDuration)Returns the rounded frame count of the given milliseconds and frame duration. |
| public final int | getSamplesByteCount(final int
sample count sampleCount)Returns the byte size of given sample count
according to the sampleCount * ( sampleSize / 8 ) |
| public final float | getSamplesDuration(final int
sample count per frame and channel sampleCount)Returns the duration in milliseconds of the given sample count per frame and channel
according to the ( 1000f * sampleCount ) / sampleRate |
| public String |
| channelCount | back to summary |
|---|---|
| public final int channelCount Number of channels. | |
| fixedP | back to summary |
|---|---|
| public final boolean fixedP Fixed or floating point values. Floating point 'float' has | |
| littleEndian | back to summary |
|---|---|
| public final boolean littleEndian | |
| planar | back to summary |
|---|---|
| public final boolean planar Planar or packed samples. If planar, each channel has their own data buffer. If packed, channel data is interleaved in one buffer. | |
| sampleRate | back to summary |
|---|---|
| public final int sampleRate Sample rate in Hz (1/s). | |
| sampleSize | back to summary |
|---|---|
| public final int sampleSize Sample size in bits. | |
| signed | back to summary |
|---|---|
| public final boolean signed | |
| AudioFormat | back to summary |
|---|---|
public AudioFormat(final int sampleRate, final int sampleSize, final int channelCount, final boolean signed, final boolean fixedP, final boolean planar, final boolean littleEndian)
| |
| getBytesDuration | back to summary |
|---|---|
| public final int getBytesDuration(final int byteCount) Returns the duration in milliseconds of the given byte count
according to Byte Count -> Time | |
| getBytesSampleCount | back to summary |
|---|---|
| public final int getBytesSampleCount(final int byteCount) Returns the sample count of given byte count
according to the ( byteCount * 8 ) / sampleSize Note If Byte Count -> Sample Count
| |
| getDurationsByteSize | back to summary |
|---|---|
| public final int getDurationsByteSize(final int millisecs) Returns the byte size of the given milliseconds
according to Time -> Byte Count | |
| getFrameCount | back to summary |
|---|---|
| public final int getFrameCount(final int millisecs, final float frameDuration) Returns the rounded frame count of the given milliseconds and frame duration.
Math.max( 1, millisecs / frameDuration + 0.5f )
Note
Frame Time -> Frame Count
| |
| getSamplesByteCount | back to summary |
|---|---|
| public final int getSamplesByteCount(final int sampleCount) Returns the byte size of given sample count
according to the sampleCount * ( sampleSize / 8 ) Note To retrieve the byte size for all channels,
you need to pre-multiply Sample Count -> Byte Count
| |
| getSamplesDuration | back to summary |
|---|---|
| public final float getSamplesDuration(final int sampleCount) Returns the duration in milliseconds of the given sample count per frame and channel
according to the ( 1000f * sampleCount ) / sampleRate Sample Count -> Time
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| protected int |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final int | |
| public final void | |
| public String | toString()
Overrides com. |
| byteSize | back to summary |
|---|---|
| protected int byteSize | |
| AudioFrame | back to summary |
|---|---|
| public AudioFrame() | |
| AudioFrame | back to summary |
|---|---|
| public AudioFrame(final int pts, final int duration, final int byteCount) | |
| getByteSize | back to summary |
|---|---|
| public final int getByteSize() Get this frame's size in bytes. | |
| setByteSize | back to summary |
|---|---|
| public final void setByteSize(final int size) Set this frame's size in bytes. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from java. Returns a string representation of the object. | |