DefaultAudioSink.DefaultAudioProcessorChain


class DefaultAudioSink.DefaultAudioProcessorChain : DefaultAudioSink.AudioProcessorChain


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

Summary

Public constructors

Creates a new default chain of audio processors, with the user-defined audioProcessors applied before silence skipping and speed adjustment processors.

DefaultAudioProcessorChain(
    audioProcessors: Array<AudioProcessor!>!,
    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.

Public functions

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(skipSilenceEnabled: Boolean)

Configures audio processors to apply whether to skip silences immediately, returning the new value.

Long
getMediaDuration(playoutDuration: Long)

Returns the media duration corresponding to the specified playout duration, taking speed adjustment due to audio processing into account.

Long

Returns the number of output audio frames skipped since the audio processors were last flushed.

Public properties

Array<AudioProcessor!>!

Public constructors

DefaultAudioProcessorChain

DefaultAudioProcessorChain(audioProcessors: Array<AudioProcessor!>!)

Creates a new default chain of audio processors, with the user-defined audioProcessors applied before silence skipping and speed adjustment processors.

DefaultAudioProcessorChain

DefaultAudioProcessorChain(
    audioProcessors: Array<AudioProcessor!>!,
    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.

Public functions

applyPlaybackParameters

fun applyPlaybackParameters(playbackParameters: PlaybackParameters!): PlaybackParameters!

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.

Parameters
playbackParameters: PlaybackParameters!

The playback parameters to try to apply.

Returns
PlaybackParameters!

The playback parameters that were actually applied.

applySkipSilenceEnabled

fun applySkipSilenceEnabled(skipSilenceEnabled: Boolean): Boolean

Configures audio processors to apply whether to skip silences immediately, returning the new value. Only called when processors have no input pending.

Parameters
skipSilenceEnabled: Boolean

Whether silences should be skipped in the audio stream.

Returns
Boolean

The new value.

getMediaDuration

fun getMediaDuration(playoutDuration: Long): Long

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.

Parameters
playoutDuration: Long

The playout duration to scale.

Returns
Long

The corresponding media duration, in the same units as duration.

getSkippedOutputFrameCount

fun getSkippedOutputFrameCount(): Long

Returns the number of output audio frames skipped since the audio processors were last flushed.

Public properties

audioProcessors

val audioProcessorsArray<AudioProcessor!>!