Class SilenceSkippingAudioProcessor
- java.lang.Object
-
- com.google.android.exoplayer2.audio.BaseAudioProcessor
-
- com.google.android.exoplayer2.audio.SilenceSkippingAudioProcessor
-
- All Implemented Interfaces:
AudioProcessor
@Deprecated public final class SilenceSkippingAudioProcessor extends BaseAudioProcessor
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.AnAudioProcessor
that skips silence in the input stream. Input and output are 16-bit PCM.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.audio.AudioProcessor
AudioProcessor.AudioFormat, AudioProcessor.UnhandledAudioFormatException
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_MINIMUM_SILENCE_DURATION_US
Deprecated.The default value forminimumSilenceDurationUs
.static long
DEFAULT_PADDING_SILENCE_US
Deprecated.The default value forpaddingSilenceUs
.static short
DEFAULT_SILENCE_THRESHOLD_LEVEL
Deprecated.The default value forsilenceThresholdLevel
.-
Fields inherited from class com.google.android.exoplayer2.audio.BaseAudioProcessor
inputAudioFormat, outputAudioFormat
-
Fields inherited from interface com.google.android.exoplayer2.audio.AudioProcessor
EMPTY_BUFFER
-
-
Constructor Summary
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.
-
Method Summary
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 toBaseAudioProcessor.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 theinputBuffer
for processing.void
setEnabled(boolean enabled)
Deprecated.Sets whether to skip silence in the input.-
Methods inherited from class com.google.android.exoplayer2.audio.BaseAudioProcessor
configure, flush, getOutput, hasPendingOutput, isEnded, queueEndOfStream, replaceOutputBuffer, reset
-
-
-
-
Field Detail
-
DEFAULT_MINIMUM_SILENCE_DURATION_US
public static final long DEFAULT_MINIMUM_SILENCE_DURATION_US
Deprecated.The default value forminimumSilenceDurationUs
.- See Also:
- Constant Field Values
-
DEFAULT_PADDING_SILENCE_US
public static final long DEFAULT_PADDING_SILENCE_US
Deprecated.The default value forpaddingSilenceUs
.- See Also:
- Constant Field Values
-
DEFAULT_SILENCE_THRESHOLD_LEVEL
public static final short DEFAULT_SILENCE_THRESHOLD_LEVEL
Deprecated.The default value forsilenceThresholdLevel
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SilenceSkippingAudioProcessor
public SilenceSkippingAudioProcessor()
Deprecated.Creates a new silence skipping audio processor.
-
SilenceSkippingAudioProcessor
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 belowsilenceThresholdLevel
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 exceedminimumSilenceDurationUs
.silenceThresholdLevel
- The absolute level below which an individual PCM sample is classified as silent.
-
-
Method Detail
-
setEnabled
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 byisActive()
may change, and the processor must beflushed
before queueing more data.- Parameters:
enabled
- Whether to skip silence in the input.
-
getSkippedFrames
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 toBaseAudioProcessor.flush()
.
-
onConfigure
@CanIgnoreReturnValue public AudioProcessor.AudioFormat onConfigure(AudioProcessor.AudioFormat inputAudioFormat) throws AudioProcessor.UnhandledAudioFormatException
Deprecated.Description copied from class:BaseAudioProcessor
Called when the processor is configured for a new input format.- Overrides:
onConfigure
in classBaseAudioProcessor
- Throws:
AudioProcessor.UnhandledAudioFormatException
-
isActive
public boolean isActive()
Deprecated.Description copied from interface:AudioProcessor
Returns whether the processor is configured and will process input buffers.- Specified by:
isActive
in interfaceAudioProcessor
- Overrides:
isActive
in classBaseAudioProcessor
-
queueInput
public void queueInput(ByteBuffer inputBuffer)
Deprecated.Description copied from interface:AudioProcessor
Queues audio data between the position and limit of theinputBuffer
for processing. After calling this method, processed output may be available viaAudioProcessor.getOutput()
. CallingqueueInput(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.
-
onQueueEndOfStream
protected void onQueueEndOfStream()
Deprecated.Description copied from class:BaseAudioProcessor
Called when the end-of-stream is queued to the processor.- Overrides:
onQueueEndOfStream
in classBaseAudioProcessor
-
onFlush
protected void onFlush()
Deprecated.Description copied from class:BaseAudioProcessor
Called when the processor is flushed, directly or as part of resetting.- Overrides:
onFlush
in classBaseAudioProcessor
-
onReset
protected void onReset()
Deprecated.Description copied from class:BaseAudioProcessor
Called when the processor is reset.- Overrides:
onReset
in classBaseAudioProcessor
-
-