public interface AudioSink
| Modifier and Type | Interface and Description |
|---|---|
static class |
AudioSink.AudioDataFormat
Specifies the audio data format.
|
static class |
AudioSink.AudioDataType
Specifies the audio data type.
|
static class |
AudioSink.AudioFrame |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
static AudioSink.AudioDataFormat |
DefaultFormat
Default
AudioSink.AudioDataFormat, [type PCM, sampleRate 44100, sampleSize 16, channelCount 2, signed, littleEndian]. |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroys this instance, i.e.
|
AudioSink.AudioDataFormat |
getPreferredFormat()
Returns the preferred
AudioSink.AudioDataFormat by this sink. |
int |
getQueuedByteCount()
Returns the number of bytes queued for playing.
|
int |
getQueuedTime()
Returns the queued buffer time in milliseconds for playing.
|
int |
getWritableBufferCount()
Returns the number of buffers in the sink available for writing.
|
AudioSink.AudioDataFormat |
initSink(AudioSink.AudioDataFormat requestedFormat,
int bufferCount)
Initializes the sink.
|
boolean |
isDataAvailable(int data_size)
Returns true if data is available to be written in the sink.
|
boolean |
isInitialized()
Returns the
initialized state of this instance. |
void |
writeData(AudioSink.AudioFrame audioFrame)
Writes the remaining bytes of the given direct ByteBuffer to this sink.
|
static final boolean DEBUG
static final AudioSink.AudioDataFormat DefaultFormat
AudioSink.AudioDataFormat, [type PCM, sampleRate 44100, sampleSize 16, channelCount 2, signed, littleEndian].boolean isInitialized()
initialized state of this instance.
The initialized state is affected by this instance
overall availability, i.e. after instantiation,
as well as by destroy().
AudioSink.AudioDataFormat getPreferredFormat()
AudioSink.AudioDataFormat by this sink.
The preferred format shall reflect this sinks most native format, i.e. best performance w/o data conversion.
#initSink(AudioDataFormat)AudioSink.AudioDataFormat initSink(AudioSink.AudioDataFormat requestedFormat, int bufferCount)
Implementation shall try to match the given requestedFormat AudioSink.AudioDataFormat
as close as possible, regarding it's capabilities.
A user may consider getPreferredFormat() and pass this value
to utilize best performance and behavior.
DefaultFormat should be supported by all implementations.
requestedFormat - the requested AudioSink.AudioDataFormat.bufferCount - number of buffers for sinkrequestedFormat and this sinks capabilities, otherwise null.void destroy()
int getQueuedByteCount()
#initSink(AudioDataFormat) must be called first.
int getQueuedTime()
#initSink(AudioDataFormat) must be called first.
int getWritableBufferCount()
#initSink(AudioDataFormat) must be called first.
boolean isDataAvailable(int data_size)
#initSink(AudioDataFormat) must be called first.
void writeData(AudioSink.AudioFrame audioFrame)
The data must comply with the chosen AudioSink.AudioDataFormat as returned by #initSink(AudioDataFormat).
Copyright 2010 JogAmp Community.