docs/doc/reference/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessor.html
Package com.google.android.exoplayer2.audio
All Implemented Interfaces:AudioProcessor
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classSilenceSkippingAudioProcessorextends[BaseAudioProcessor](BaseAudioProcessor.html "class 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.
An AudioProcessor that skips silence in the input stream. Input and output are 16-bit PCM.
-
AudioProcessor.AudioFormat, AudioProcessor.UnhandledAudioFormatException
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static long | DEFAULT_MINIMUM_SILENCE_DURATION_US |
Deprecated.
The default value for minimumSilenceDurationUs.
|
| static long | DEFAULT_PADDING_SILENCE_US |
Deprecated.
The default value for paddingSilenceUs.
|
| static short | DEFAULT_SILENCE_THRESHOLD_LEVEL |
Deprecated.
The default value for silenceThresholdLevel.
|
-
inputAudioFormat, outputAudioFormat
-
EMPTY_BUFFER
Constructors | Constructor | Description |
| --- | --- |
| SilenceSkippingAudioProcessor() |
Deprecated.
Creates a new silence skipping audio processor.
|
| SilenceSkippingAudioProcessor(long minimumSilenceDurationUs, long paddingSilenceUs, short silenceThresholdLevel) |
Deprecated.
Creates a new silence skipping audio processor. |
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| long | getSkippedFrames() |
Deprecated.
Returns the total number of frames of input audio that were skipped due to being classified as silence since the last call to BaseAudioProcessor.flush().
|
| boolean | isActive() |
Deprecated.
Returns whether the processor is configured and will process input buffers.
|
| 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 | queueInput(ByteBuffer inputBuffer) |
Deprecated.
Queues audio data between the position and limit of the inputBuffer for processing.
|
| void | setEnabled(boolean enabled) |
Deprecated.
Sets whether to skip silence in the input. |
-
configure, flush, getOutput, hasPendingOutput, isEnded, queueEndOfStream, replaceOutputBuffer, reset
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public static final long DEFAULT_MINIMUM_SILENCE_DURATION_US
Deprecated.
The default value for minimumSilenceDurationUs.
See Also:Constant Field Values
-
public static final long DEFAULT_PADDING_SILENCE_US
Deprecated.
The default value for paddingSilenceUs.
See Also:Constant Field Values
-
public static final short DEFAULT_SILENCE_THRESHOLD_LEVEL
Deprecated.
The default value for silenceThresholdLevel.
See Also:Constant Field Values
-
public SilenceSkippingAudioProcessor()
Deprecated.
Creates a new silence skipping audio processor.
-
public SilenceSkippingAudioProcessor(long minimumSilenceDurationUs,
long paddingSilenceUs,
short silenceThresholdLevel)
Deprecated.
Creates a new silence skipping audio processor.
Parameters:minimumSilenceDurationUs - The minimum duration of audio that must be below silenceThresholdLevel to classify that part of audio as silent, in microseconds.paddingSilenceUs - The duration of silence by which to extend non-silent sections, in microseconds. The value must not exceed minimumSilenceDurationUs.silenceThresholdLevel - The absolute level below which an individual PCM sample is classified as silent.
-
public void setEnabled(boolean enabled)
Deprecated.
Sets whether to skip silence in the input. This method may only be called after draining data through the processor. The value returned by isActive() may change, and the processor must be flushed before queueing more data.
Parameters:enabled - Whether to skip silence in the input.
-
public long getSkippedFrames()
Deprecated.
Returns the total number of frames of input audio that were skipped due to being classified as silence since the last call to BaseAudioProcessor.flush().
-
@CanIgnoreReturnValue
public[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.
Description copied from class: BaseAudioProcessor
Called when the processor is configured for a new input format.
Overrides:onConfigure in class BaseAudioProcessorThrows:AudioProcessor.UnhandledAudioFormatException
-
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 AudioProcessorOverrides:isActive in class BaseAudioProcessor
-
public void queueInput([ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")inputBuffer)
Deprecated.
Description copied from interface: AudioProcessor
Queues audio data between the position and limit of the inputBuffer for processing. After calling this method, processed output may be available via AudioProcessor.getOutput(). Calling queueInput(ByteBuffer) again invalidates any pending output.
Parameters:inputBuffer - The input buffer to process. It must be a direct byte buffer with native byte order. Its contents are treated as read-only. Its position will be advanced by the number of bytes consumed (which may be zero). The caller retains ownership of the provided buffer.
-
protected void onQueueEndOfStream()
Deprecated.
Description copied from class: BaseAudioProcessor
Called when the end-of-stream is queued to the processor.
Overrides:onQueueEndOfStream in class BaseAudioProcessor
-
protected void onFlush()
Deprecated.
Description copied from class: BaseAudioProcessor
Called when the processor is flushed, directly or as part of resetting.
Overrides:onFlush in class BaseAudioProcessor
-
protected void onReset()
Deprecated.
Description copied from class: BaseAudioProcessor
Called when the processor is reset.
Overrides:onReset in class BaseAudioProcessor