Back to Exoplayer

SilenceSkippingAudioProcessor (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessor.html

latest9.9 KB
Original Source

Package com.google.android.exoplayer2.audio

Class SilenceSkippingAudioProcessor


[@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.

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 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. |

- 

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 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. |

- 

Methods inherited from class com.google.android.exoplayer2.audio.BaseAudioProcessor

configure, flush, getOutput, hasPendingOutput, isEnded, queueEndOfStream, replaceOutputBuffer, reset

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

DEFAULT_MINIMUM_SILENCE_DURATION_US

public static final long DEFAULT_MINIMUM_SILENCE_DURATION_US

Deprecated.

The default value for minimumSilenceDurationUs. See Also:Constant Field Values

- 

DEFAULT_PADDING_SILENCE_US

public static final long DEFAULT_PADDING_SILENCE_US

Deprecated.

The default value for paddingSilenceUs. See Also:Constant Field Values

- 

DEFAULT_SILENCE_THRESHOLD_LEVEL

public static final short DEFAULT_SILENCE_THRESHOLD_LEVEL

Deprecated.

The default value for silenceThresholdLevel. 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 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.

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 by isActive() may change, and the processor must be flushed 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 to BaseAudioProcessor.flush().

- 

onConfigure

@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

- 

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 interface AudioProcessorOverrides:isActive in class BaseAudioProcessor

- 

queueInput

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.

- 

onQueueEndOfStream

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

- 

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 class BaseAudioProcessor

- 

onReset

protected void onReset()

Deprecated.

Description copied from class: BaseAudioProcessor

Called when the processor is reset. Overrides:onReset in class BaseAudioProcessor