AudioSink.AudioSinkConfig.Builder


class AudioSink.AudioSinkConfig.Builder


Builder for AudioSinkConfig.

Summary

Public constructors

Builder(format: Format!)

Creates a new builder.

Public functions

AudioSink.AudioSinkConfig!

Builds an AudioSinkConfig instance.

AudioSink.AudioSinkConfig.Builder!

Sets the MediaPeriodId of the playback this audio sink is configured for.

AudioSink.AudioSinkConfig.Builder!

Sets a mapping from input to output channels.

AudioSink.AudioSinkConfig.Builder!

This function is deprecated.

Use similar setters on lower-level components like AudioOutput instead, e.g. by modifying preferredBufferSize.

AudioSink.AudioSinkConfig.Builder!

Sets the Timeline of the playback this audio sink is configured for.

Public constructors

Builder

Builder(format: Format!)

Creates a new builder.

Parameters
format: Format!

The format of audio data provided in the input buffers.

Public functions

build

fun build(): AudioSink.AudioSinkConfig!

Builds an AudioSinkConfig instance.

setMediaPeriodId

@CanIgnoreReturnValue
fun setMediaPeriodId(mediaPeriodId: MediaSource.MediaPeriodId?): AudioSink.AudioSinkConfig.Builder!

Sets the MediaPeriodId of the playback this audio sink is configured for.

Can be used together with the Timeline to identify the concrete item in the playlist.

If the MediaPeriodId is non-null and the provided Timeline non-empty, the value must refer to a valid period in the provided Timeline.

Parameters
mediaPeriodId: MediaSource.MediaPeriodId?

The MediaPeriodId, or null to leave it undefined.

Returns
AudioSink.AudioSinkConfig.Builder!

This builder.

setOutputChannelMapping

@CanIgnoreReturnValue
fun setOutputChannelMapping(outputChannelMapping: ImmutableIntArray?): AudioSink.AudioSinkConfig.Builder!

Sets a mapping from input to output channels.

Parameters
outputChannelMapping: ImmutableIntArray?

A mapping from input to output channels that is applied to this sink's input as a preprocessing step, if handling PCM input. Specify null to leave the input unchanged. Otherwise, the element at index i specifies index of the input channel to map to output channel i when preprocessing input buffers. After the map is applied the audio data will have outputChannels.length channels.

Returns
AudioSink.AudioSinkConfig.Builder!

This builder.

setPreferredBufferSizeOverride

@CanIgnoreReturnValue
fun setPreferredBufferSizeOverride(preferredBufferSizeOverride: Int): AudioSink.AudioSinkConfig.Builder!

Sets a specific size for the playback buffer in bytes.

This method should not be needed as the buffer size is only applicable to lower-level components like the AudioOutput and should be set there.

Parameters
preferredBufferSizeOverride: Int

A specific size for the playback buffer in bytes, or 0 to infer a suitable buffer size automatically.

Returns
AudioSink.AudioSinkConfig.Builder!

This builder.

setTimeline

@CanIgnoreReturnValue
fun setTimeline(timeline: Timeline!): AudioSink.AudioSinkConfig.Builder!

Sets the Timeline of the playback this audio sink is configured for.

Can be used together with the MediaPeriodId to identify the concrete item in the playlist.

Parameters
timeline: Timeline!

The Timeline.

Returns
AudioSink.AudioSinkConfig.Builder!

This builder.