Back to Exoplayer

DefaultAudioSink.DefaultAudioProcessorChain (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/audio/DefaultAudioSink.DefaultAudioProcessorChain.html

latest6.9 KB
Original Source

Package com.google.android.exoplayer2.audio

Class DefaultAudioSink.DefaultAudioProcessorChain

  • java.lang.Object

    • com.google.android.exoplayer2.audio.DefaultAudioSink.DefaultAudioProcessorChain
  • All Implemented Interfaces:AudioProcessorChain, DefaultAudioSink.AudioProcessorChainEnclosing class:DefaultAudioSink


public static classDefaultAudioSink.DefaultAudioProcessorChainextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[DefaultAudioSink.AudioProcessorChain](DefaultAudioSink.AudioProcessorChain.html "interface in com.google.android.exoplayer2.audio")

The default audio processor chain, which applies a (possibly empty) chain of user-defined audio processors followed by SilenceSkippingAudioProcessor and SonicAudioProcessor.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | 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​(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 Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | PlaybackParameters | applyPlaybackParameters​(PlaybackParameters playbackParameters) | Configures audio processors to apply the specified playback parameters immediately, returning the new playback parameters, which may differ from those passed in. | | boolean | applySkipSilenceEnabled​(boolean skipSilenceEnabled) | Configures audio processors to apply whether to skip silences immediately, returning the new value. | | AudioProcessor[] | getAudioProcessors() | Returns the fixed chain of audio processors that will process audio. | | long | getMediaDuration​(long playoutDuration) | Returns the media duration corresponding to the specified playout duration, taking speed adjustment due to audio processing into account. | | long | getSkippedOutputFrameCount() | Returns the number of output audio frames skipped since the audio processors were last flushed. |

- 

Methods inherited from class java.lang.Object

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

Constructor Detail

- 

DefaultAudioProcessorChain

public DefaultAudioProcessorChain​([AudioProcessor](AudioProcessor.html "interface in com.google.android.exoplayer2.audio")... 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](AudioProcessor.html "interface in com.google.android.exoplayer2.audio")[] audioProcessors,[SilenceSkippingAudioProcessor](SilenceSkippingAudioProcessor.html "class in com.google.android.exoplayer2.audio")silenceSkippingAudioProcessor,[SonicAudioProcessor](SonicAudioProcessor.html "class in com.google.android.exoplayer2.audio")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](AudioProcessor.html "interface in com.google.android.exoplayer2.audio")[] 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](../PlaybackParameters.html "class in com.google.android.exoplayer2")applyPlaybackParameters​([PlaybackParameters](../PlaybackParameters.html "class in com.google.android.exoplayer2")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 AudioProcessorChainParameters: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 AudioProcessorChainParameters: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 AudioProcessorChainParameters:playoutDuration - The playout duration to scale.Returns:The corresponding media duration, in the same units as duration.

- 

getSkippedOutputFrameCount

public long getSkippedOutputFrameCount()

Description copied from interface: AudioProcessorChain

Returns the number of output audio frames skipped since the audio processors were last flushed. Specified by:getSkippedOutputFrameCount in interface AudioProcessorChain