docs/doc/reference/com/google/android/exoplayer2/audio/BaseAudioProcessor.html
Package com.google.android.exoplayer2.audio
All Implemented Interfaces:AudioProcessorDirect Known Subclasses:ChannelMixingAudioProcessor, SilenceSkippingAudioProcessor, TeeAudioProcessor, ToInt16PcmAudioProcessor
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classBaseAudioProcessorextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[AudioProcessor](AudioProcessor.html "interface in com.google.android.exoplayer2.audio")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Base class for audio processors that keep an output buffer and an internal buffer that is reused whenever input is queued. Subclasses should override onConfigure(AudioFormat) to return the output audio format for the processor if it's active.
-
AudioProcessor.AudioFormat, AudioProcessor.UnhandledAudioFormatException
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| protected AudioProcessor.AudioFormat | inputAudioFormat |
Deprecated.
The current input audio format.
|
| protected AudioProcessor.AudioFormat | outputAudioFormat |
Deprecated.
The current output audio format. |
-
EMPTY_BUFFER
Constructors | Constructor | Description |
| --- | --- |
| BaseAudioProcessor() |
Deprecated.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| AudioProcessor.AudioFormat | configure(AudioProcessor.AudioFormat inputAudioFormat) |
Deprecated.
Configures the processor to process input audio with the specified format.
|
| void | flush() |
Deprecated.
Clears any buffered data and pending output.
|
| ByteBuffer | getOutput() |
Deprecated.
Returns a buffer containing processed output data between its position and limit.
|
| protected boolean | hasPendingOutput() |
Deprecated.
Returns whether the current output buffer has any data remaining.
|
| boolean | isActive() |
Deprecated.
Returns whether the processor is configured and will process input buffers.
|
| boolean | isEnded() |
Deprecated.
Returns whether this processor will return no more output from AudioProcessor.getOutput() until AudioProcessor.flush() has been called and more input has been queued.
|
| protected AudioProcessor.AudioFormat | onConfigure(AudioProcessor.AudioFormat inputAudioFormat) |
Deprecated.
Called when the processor is configured for a new input format.
|
| protected void | onFlush() |
Deprecated.
Called when the processor is flushed, directly or as part of resetting.
|
| protected void | onQueueEndOfStream() |
Deprecated.
Called when the end-of-stream is queued to the processor.
|
| protected void | onReset() |
Deprecated.
Called when the processor is reset.
|
| void | queueEndOfStream() |
Deprecated.
Queues an end of stream signal.
|
| protected ByteBuffer | replaceOutputBuffer(int size) |
Deprecated.
Replaces the current output buffer with a buffer of at least size bytes and returns it.
|
| void | reset() |
Deprecated.
Resets the processor to its unconfigured state, releasing any resources. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
queueInput
-
protected[AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")inputAudioFormat
Deprecated.
The current input audio format.
-
protected[AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")outputAudioFormat
Deprecated.
The current output audio format.
-
public BaseAudioProcessor()
Deprecated.
-
@CanIgnoreReturnValue
public final[AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")configure([AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")inputAudioFormat)
throws[AudioProcessor.UnhandledAudioFormatException](AudioProcessor.UnhandledAudioFormatException.html "class in com.google.android.exoplayer2.audio")
Deprecated.
Description copied from interface: AudioProcessor
Configures the processor to process input audio with the specified format. After calling this method, call AudioProcessor.isActive() to determine whether the audio processor is active. Returns the configured output audio format if this instance is active.
After calling this method, it is necessary to AudioProcessor.flush() the processor to apply the new configuration. Before applying the new configuration, it is safe to queue input and get output in the old input/output formats. Call AudioProcessor.queueEndOfStream() when no more input will be supplied in the old input format.
Specified by:configure in interface AudioProcessorParameters:inputAudioFormat - The format of audio that will be queued after the next call to AudioProcessor.flush().Returns:The configured output audio format if this instance is active.Throws:AudioProcessor.UnhandledAudioFormatException - Thrown if the specified format can't be handled as input.
-
public boolean isActive()
Deprecated.
Description copied from interface: AudioProcessor
Returns whether the processor is configured and will process input buffers.
Specified by:isActive in interface AudioProcessor
-
public final void queueEndOfStream()
Deprecated.
Description copied from interface: AudioProcessor
Queues an end of stream signal. After this method has been called, AudioProcessor.queueInput(ByteBuffer) may not be called until after the next call to AudioProcessor.flush(). Calling AudioProcessor.getOutput() will return any remaining output data. Multiple calls may be required to read all of the remaining output data. AudioProcessor.isEnded() will return true once all remaining output data has been read.
Specified by:queueEndOfStream in interface AudioProcessor
-
@CallSuper
public[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")getOutput()
Deprecated.
Description copied from interface: AudioProcessor
Returns a buffer containing processed output data between its position and limit. The buffer will always be a direct byte buffer with native byte order. Calling this method invalidates any previously returned buffer. The buffer will be empty if no output is available.
Specified by:getOutput in interface AudioProcessorReturns:A buffer containing processed output data between its position and limit.
-
@CallSuper
public boolean isEnded()
Deprecated.
Description copied from interface: AudioProcessor
Returns whether this processor will return no more output from AudioProcessor.getOutput() until AudioProcessor.flush() has been called and more input has been queued.
Specified by:isEnded in interface AudioProcessor
-
public final void flush()
Deprecated.
Description copied from interface: AudioProcessor
Clears any buffered data and pending output. If the audio processor is active, also prepares the audio processor to receive a new stream of input in the last configured (pending) format.
Specified by:flush in interface AudioProcessor
-
public final void reset()
Deprecated.
Description copied from interface: AudioProcessor
Resets the processor to its unconfigured state, releasing any resources.
Specified by:reset in interface AudioProcessor
-
protected final[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")replaceOutputBuffer(int size)
Deprecated.
Replaces the current output buffer with a buffer of at least size bytes and returns it. Callers should write to the returned buffer then ByteBuffer.flip() it so it can be read via getOutput().
-
protected final boolean hasPendingOutput()
Deprecated.
Returns whether the current output buffer has any data remaining.
-
@CanIgnoreReturnValue
protected[AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")onConfigure([AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")inputAudioFormat)
throws[AudioProcessor.UnhandledAudioFormatException](AudioProcessor.UnhandledAudioFormatException.html "class in com.google.android.exoplayer2.audio")
Deprecated.
Called when the processor is configured for a new input format.
Throws:AudioProcessor.UnhandledAudioFormatException
-
protected void onQueueEndOfStream()
Deprecated.
Called when the end-of-stream is queued to the processor.
-
protected void onFlush()
Deprecated.
Called when the processor is flushed, directly or as part of resetting.
-
protected void onReset()
Deprecated.
Called when the processor is reset.