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.AnAudioProcessorthat 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 longDEFAULT_MINIMUM_SILENCE_DURATION_USDeprecated.The default value forminimumSilenceDurationUs.static longDEFAULT_PADDING_SILENCE_USDeprecated.The default value forpaddingSilenceUs.static shortDEFAULT_SILENCE_THRESHOLD_LEVELDeprecated.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 longgetSkippedFrames()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().booleanisActive()Deprecated.Returns whether the processor is configured and will process input buffers.AudioProcessor.AudioFormatonConfigure(AudioProcessor.AudioFormat inputAudioFormat)Deprecated.Called when the processor is configured for a new input format.protected voidonFlush()Deprecated.Called when the processor is flushed, directly or as part of resetting.protected voidonQueueEndOfStream()Deprecated.Called when the end-of-stream is queued to the processor.protected voidonReset()Deprecated.Called when the processor is reset.voidqueueInput(ByteBuffer inputBuffer)Deprecated.Queues audio data between the position and limit of theinputBufferfor processing.voidsetEnabled(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 belowsilenceThresholdLevelto 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 beflushedbefore 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:BaseAudioProcessorCalled when the processor is configured for a new input format.- Overrides:
onConfigurein classBaseAudioProcessor- Throws:
AudioProcessor.UnhandledAudioFormatException
-
isActive
public boolean isActive()
Deprecated.Description copied from interface:AudioProcessorReturns whether the processor is configured and will process input buffers.- Specified by:
isActivein interfaceAudioProcessor- Overrides:
isActivein classBaseAudioProcessor
-
queueInput
public void queueInput(ByteBuffer inputBuffer)
Deprecated.Description copied from interface:AudioProcessorQueues audio data between the position and limit of theinputBufferfor 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:BaseAudioProcessorCalled when the end-of-stream is queued to the processor.- Overrides:
onQueueEndOfStreamin classBaseAudioProcessor
-
onFlush
protected void onFlush()
Deprecated.Description copied from class:BaseAudioProcessorCalled when the processor is flushed, directly or as part of resetting.- Overrides:
onFlushin classBaseAudioProcessor
-
onReset
protected void onReset()
Deprecated.Description copied from class:BaseAudioProcessorCalled when the processor is reset.- Overrides:
onResetin classBaseAudioProcessor
-
-