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

      • getAudioProcessors

        public AudioProcessor[] getAudioProcessors()
        Description copied from interface: AudioProcessorChain
        Returns the fixed chain of audio processors that will process audio. This method is called once during initialization, but audio processors may change state to become active/inactive during playback.
        Specified by:
        getAudioProcessors in interface AudioProcessorChain
      • applyPlaybackParameters

        public PlaybackParameters applyPlaybackParameters​(PlaybackParameters playbackParameters)
        Description copied from interface: AudioProcessorChain
        Configures audio processors to apply the specified playback parameters immediately, returning the new playback parameters, which may differ from those passed in. Only called when processors have no input pending.
        Specified by:
        applyPlaybackParameters in interface AudioProcessorChain
        Parameters:
        playbackParameters - The playback parameters to try to apply.
        Returns:
        The playback parameters that were actually applied.
      • applySkipSilenceEnabled

        public boolean applySkipSilenceEnabled​(boolean skipSilenceEnabled)
        Description copied from interface: 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 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: 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 AudioProcessorChain
        Parameters:
        playoutDuration - The playout duration to scale.
        Returns:
        The corresponding media duration, in the same units as duration.