DefaultAudioTrackBufferSizeProvider.Builder


public class DefaultAudioTrackBufferSizeProvider.Builder


A builder to create DefaultAudioTrackBufferSizeProvider instances.

Summary

Public constructors

Creates a new builder.

Public methods

DefaultAudioTrackBufferSizeProvider

Build the DefaultAudioTrackBufferSizeProvider.

DefaultAudioTrackBufferSizeProvider.Builder
@CanIgnoreReturnValue
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).

DefaultAudioTrackBufferSizeProvider.Builder
@CanIgnoreReturnValue
setDtshdBufferMultiplicationFactor(
    int dtshdBufferMultiplicationFactor
)

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

DefaultAudioTrackBufferSizeProvider.Builder
@CanIgnoreReturnValue
setMaxPcmBufferDurationUs(int maxPcmBufferDurationUs)

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

DefaultAudioTrackBufferSizeProvider.Builder
@CanIgnoreReturnValue
setMinPcmBufferDurationUs(int minPcmBufferDurationUs)

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

DefaultAudioTrackBufferSizeProvider.Builder
@CanIgnoreReturnValue
setOffloadBufferDurationUs(int offloadBufferDurationUs)

The length for offload AudioTrack buffers, in microseconds.

DefaultAudioTrackBufferSizeProvider.Builder
@CanIgnoreReturnValue
setPassthroughBufferDurationUs(int passthroughBufferDurationUs)

Sets the length for passthrough AudioTrack buffers, in microseconds.

DefaultAudioTrackBufferSizeProvider.Builder
@CanIgnoreReturnValue
setPcmBufferMultiplicationFactor(int pcmBufferMultiplicationFactor)

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

Public constructors

Builder

public Builder()

Creates a new builder.

Public methods

setAc3BufferMultiplicationFactor

@CanIgnoreReturnValue
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 AC3_BUFFER_MULTIPLICATION_FACTOR.

setDtshdBufferMultiplicationFactor

@CanIgnoreReturnValue
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 DTSHD_BUFFER_MULTIPLICATION_FACTOR.

setMaxPcmBufferDurationUs

@CanIgnoreReturnValue
public DefaultAudioTrackBufferSizeProvider.Builder setMaxPcmBufferDurationUs(int maxPcmBufferDurationUs)

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

setMinPcmBufferDurationUs

@CanIgnoreReturnValue
public DefaultAudioTrackBufferSizeProvider.Builder setMinPcmBufferDurationUs(int minPcmBufferDurationUs)

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

setOffloadBufferDurationUs

@CanIgnoreReturnValue
public DefaultAudioTrackBufferSizeProvider.Builder setOffloadBufferDurationUs(int offloadBufferDurationUs)

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

setPassthroughBufferDurationUs

@CanIgnoreReturnValue
public DefaultAudioTrackBufferSizeProvider.Builder setPassthroughBufferDurationUs(int passthroughBufferDurationUs)

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

setPcmBufferMultiplicationFactor

@CanIgnoreReturnValue
public DefaultAudioTrackBufferSizeProvider.Builder setPcmBufferMultiplicationFactor(int pcmBufferMultiplicationFactor)

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