public class

DefaultAudioTrackBufferSizeProvider.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.exoplayer.audio.DefaultAudioTrackBufferSizeProvider.Builder

Overview

A builder to create DefaultAudioTrackBufferSizeProvider instances.

Summary

Constructors
publicBuilder()

Creates a new builder.

Methods
public DefaultAudioTrackBufferSizeProviderbuild()

Build the DefaultAudioTrackBufferSizeProvider.

public DefaultAudioTrackBufferSizeProvider.BuildersetAc3BufferMultiplicationFactor(int ac3BufferMultiplicationFactor)

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

public DefaultAudioTrackBufferSizeProvider.BuildersetDtshdBufferMultiplicationFactor(int dtshdBufferMultiplicationFactor)

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

public DefaultAudioTrackBufferSizeProvider.BuildersetMaxPcmBufferDurationUs(int maxPcmBufferDurationUs)

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

public DefaultAudioTrackBufferSizeProvider.BuildersetMinPcmBufferDurationUs(int minPcmBufferDurationUs)

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

public DefaultAudioTrackBufferSizeProvider.BuildersetOffloadBufferDurationUs(int offloadBufferDurationUs)

The length for offload AudioTrack buffers, in microseconds.

public DefaultAudioTrackBufferSizeProvider.BuildersetPassthroughBufferDurationUs(int passthroughBufferDurationUs)

Sets the length for passthrough AudioTrack buffers, in microseconds.

public DefaultAudioTrackBufferSizeProvider.BuildersetPcmBufferMultiplicationFactor(int pcmBufferMultiplicationFactor)

Sets the multiplication factor to apply to the minimum buffer size requested.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a new builder.

Methods

public DefaultAudioTrackBufferSizeProvider.Builder setMinPcmBufferDurationUs(int minPcmBufferDurationUs)

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

public DefaultAudioTrackBufferSizeProvider.Builder setMaxPcmBufferDurationUs(int maxPcmBufferDurationUs)

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

public DefaultAudioTrackBufferSizeProvider.Builder setPcmBufferMultiplicationFactor(int pcmBufferMultiplicationFactor)

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

public DefaultAudioTrackBufferSizeProvider.Builder setPassthroughBufferDurationUs(int passthroughBufferDurationUs)

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

public DefaultAudioTrackBufferSizeProvider.Builder setOffloadBufferDurationUs(int offloadBufferDurationUs)

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

public DefaultAudioTrackBufferSizeProvider.Builder setAc3BufferMultiplicationFactor(int ac3BufferMultiplicationFactor)

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

public DefaultAudioTrackBufferSizeProvider.Builder setDtshdBufferMultiplicationFactor(int dtshdBufferMultiplicationFactor)

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

Build the DefaultAudioTrackBufferSizeProvider.