Class 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.
    An AudioProcessor that skips silence in the input stream. Input and output are 16-bit PCM.
    • 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().
      • queueInput

        public void queueInput​(ByteBuffer 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.
      • 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