Class DefaultAudioSink.DefaultAudioProcessorChain

    • Constructor Detail

      • DefaultAudioProcessorChain

        public DefaultAudioProcessorChain​(AudioProcessor... audioProcessors)
        Creates a new default chain of audio processors, with the user-defined audioProcessors applied before silence skipping and speed adjustment processors.
      • DefaultAudioProcessorChain

        public DefaultAudioProcessorChain​(AudioProcessor[] audioProcessors,
                                          SilenceSkippingAudioProcessor silenceSkippingAudioProcessor,
                                          SonicAudioProcessor sonicAudioProcessor)
        Creates a new default chain of audio processors, with the user-defined audioProcessors applied before silence skipping and speed adjustment processors.
    • Method Detail

      • applySkipSilenceEnabled

        public boolean applySkipSilenceEnabled​(boolean skipSilenceEnabled)
        Description copied from interface: DefaultAudioSink.AudioProcessorChain
        Configures audio processors to apply whether to skip silences immediately, returning the new value. Only called when processors have no input pending.
        Specified by:
        applySkipSilenceEnabled in interface DefaultAudioSink.AudioProcessorChain
        Parameters:
        skipSilenceEnabled - Whether silences should be skipped in the audio stream.
        Returns:
        The new value.
      • getMediaDuration

        public long getMediaDuration​(long playoutDuration)
        Description copied from interface: DefaultAudioSink.AudioProcessorChain
        Returns the media duration corresponding to the specified playout duration, taking speed adjustment due to audio processing into account.

        The scaling performed by this method will use the actual playback speed achieved by the audio processor chain, on average, since it was last flushed. This may differ very slightly from the target playback speed.

        Specified by:
        getMediaDuration in interface DefaultAudioSink.AudioProcessorChain
        Parameters:
        playoutDuration - The playout duration to scale.
        Returns:
        The corresponding media duration, in the same units as duration.