Class SilenceSkippingAudioProcessor

    • Constructor Detail

      • SilenceSkippingAudioProcessor

        public SilenceSkippingAudioProcessor()
        Creates a new silence skipping audio processor.
      • SilenceSkippingAudioProcessor

        public SilenceSkippingAudioProcessor​(long minimumSilenceDurationUs,
                                             long paddingSilenceUs,
                                             short silenceThresholdLevel)
        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)
        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()
        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)
        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.