DefaultAudioTrackBufferSizeProvider.Builder


class DefaultAudioTrackBufferSizeProvider.Builder


A builder to create DefaultAudioTrackBufferSizeProvider instances.

Summary

Public constructors

Creates a new builder.

Public functions

DefaultAudioTrackBufferSizeProvider!

Build the DefaultAudioTrackBufferSizeProvider.

DefaultAudioTrackBufferSizeProvider.Builder!

Sets the multiplication factor to apply to the passthrough buffer for AC3 to avoid underruns on some devices (e.g., Broadcom 7271).

DefaultAudioTrackBufferSizeProvider.Builder!
@CanIgnoreReturnValue
setDtshdBufferMultiplicationFactor(
    dtshdBufferMultiplicationFactor: Int
)

Sets the multiplication factor to apply to the passthrough buffer for DTS-HD (DTS Express) to avoid underruns.

DefaultAudioTrackBufferSizeProvider.Builder!

This function is deprecated.

This constraint does not apply to the new default fixed buffer size logic.

DefaultAudioTrackBufferSizeProvider.Builder!

This function is deprecated.

This constraint does not apply to the new default fixed buffer size logic.

DefaultAudioTrackBufferSizeProvider.Builder!

The length for offload AudioTrack buffers, in microseconds.

DefaultAudioTrackBufferSizeProvider.Builder!

Sets the length for passthrough AudioTrack buffers, in microseconds.

DefaultAudioTrackBufferSizeProvider.Builder!

This function is deprecated.

Use the default fixed buffer size logic instead, or configure a fixed target using setTargetPcmBufferDurationUs.

DefaultAudioTrackBufferSizeProvider.Builder!

Sets the target length for PCM AudioTrack buffers, in microseconds.

Public constructors

Builder

Builder()

Creates a new builder.

Public functions

setAc3BufferMultiplicationFactor

@CanIgnoreReturnValue
fun setAc3BufferMultiplicationFactor(ac3BufferMultiplicationFactor: Int): DefaultAudioTrackBufferSizeProvider.Builder!

Sets the multiplication factor to apply to the passthrough buffer for AC3 to avoid underruns on some devices (e.g., Broadcom 7271). Default is AC3_BUFFER_MULTIPLICATION_FACTOR.

setDtshdBufferMultiplicationFactor

@CanIgnoreReturnValue
fun setDtshdBufferMultiplicationFactor(
    dtshdBufferMultiplicationFactor: Int
): DefaultAudioTrackBufferSizeProvider.Builder!

Sets the multiplication factor to apply to the passthrough buffer for DTS-HD (DTS Express) to avoid underruns. Default is DTSHD_BUFFER_MULTIPLICATION_FACTOR.

setMaxPcmBufferDurationUs

@CanIgnoreReturnValue
fun setMaxPcmBufferDurationUs(maxPcmBufferDurationUs: Int): DefaultAudioTrackBufferSizeProvider.Builder!

Sets the maximum length for PCM AudioTrack buffers, in microseconds. Default is MAX_PCM_BUFFER_DURATION_US.

setMinPcmBufferDurationUs

@CanIgnoreReturnValue
fun setMinPcmBufferDurationUs(minPcmBufferDurationUs: Int): DefaultAudioTrackBufferSizeProvider.Builder!

Sets the minimum length for PCM AudioTrack buffers, in microseconds. Default is MIN_PCM_BUFFER_DURATION_US.

setOffloadBufferDurationUs

@CanIgnoreReturnValue
fun setOffloadBufferDurationUs(offloadBufferDurationUs: Int): DefaultAudioTrackBufferSizeProvider.Builder!

The length for offload AudioTrack buffers, in microseconds. Default is OFFLOAD_BUFFER_DURATION_US.

setPassthroughBufferDurationUs

@CanIgnoreReturnValue
fun setPassthroughBufferDurationUs(passthroughBufferDurationUs: Int): DefaultAudioTrackBufferSizeProvider.Builder!

Sets the length for passthrough AudioTrack buffers, in microseconds. Default is PASSTHROUGH_BUFFER_DURATION_US.

setPcmBufferMultiplicationFactor

@CanIgnoreReturnValue
fun setPcmBufferMultiplicationFactor(pcmBufferMultiplicationFactor: Int): DefaultAudioTrackBufferSizeProvider.Builder!

Sets the multiplication factor to apply to the minimum buffer size requested. Default is PCM_BUFFER_MULTIPLICATION_FACTOR.

Calling this method with a value other than LENGTH_UNSET enables the deprecated dynamic buffer size logic.

setTargetPcmBufferDurationUs

@CanIgnoreReturnValue
fun setTargetPcmBufferDurationUs(targetPcmBufferDurationUs: Int): DefaultAudioTrackBufferSizeProvider.Builder!

Sets the target length for PCM AudioTrack buffers, in microseconds.