Package com.google.android.exoplayer2.audio

## Class DefaultAudioTrackBufferSizeProvider.Builder

- java.lang.Object
- - com.google.android.exoplayer2.audio.DefaultAudioTrackBufferSizeProvider.Builder

- Enclosing class:
    DefaultAudioTrackBufferSizeProvider

      public static class DefaultAudioTrackBufferSizeProvider.Builder
      extends Object

  A builder to create `DefaultAudioTrackBufferSizeProvider` instances.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Builder()` | Creates a new builder.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DefaultAudioTrackBufferSizeProvider` | `build()` | Build the `DefaultAudioTrackBufferSizeProvider`.
    `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).
    `DefaultAudioTrackBufferSizeProvider.Builder` | `setMaxPcmBufferDurationUs​(int maxPcmBufferDurationUs)` | Sets the maximum length for PCM `AudioTrack` buffers, in microseconds.
    `DefaultAudioTrackBufferSizeProvider.Builder` | `setMinPcmBufferDurationUs​(int minPcmBufferDurationUs)` | Sets the minimum length for PCM `AudioTrack` buffers, in microseconds.
    `DefaultAudioTrackBufferSizeProvider.Builder` | `setOffloadBufferDurationUs​(int offloadBufferDurationUs)` | The length for offload `AudioTrack` buffers, in microseconds.
    `DefaultAudioTrackBufferSizeProvider.Builder` | `setPassthroughBufferDurationUs​(int passthroughBufferDurationUs)` | Sets the length for passthrough `AudioTrack` buffers, in microseconds.
    `DefaultAudioTrackBufferSizeProvider.Builder` | `setPcmBufferMultiplicationFactor​(int pcmBufferMultiplicationFactor)` | Sets the multiplication factor to apply to the minimum buffer size requested.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Builder

          public Builder()

      Creates a new builder.

  - ### Method Detail

    - #### setMinPcmBufferDurationUs

          @CanIgnoreReturnValue
          public DefaultAudioTrackBufferSizeProvider.Builder setMinPcmBufferDurationUs​(int minPcmBufferDurationUs)

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

    - #### setMaxPcmBufferDurationUs

          @CanIgnoreReturnValue
          public DefaultAudioTrackBufferSizeProvider.Builder setMaxPcmBufferDurationUs​(int maxPcmBufferDurationUs)

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

    - #### setPcmBufferMultiplicationFactor

          @CanIgnoreReturnValue
          public DefaultAudioTrackBufferSizeProvider.Builder setPcmBufferMultiplicationFactor​(int pcmBufferMultiplicationFactor)

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

    - #### setPassthroughBufferDurationUs

          @CanIgnoreReturnValue
          public DefaultAudioTrackBufferSizeProvider.Builder setPassthroughBufferDurationUs​(int passthroughBufferDurationUs)

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

    - #### setOffloadBufferDurationUs

          @CanIgnoreReturnValue
          public DefaultAudioTrackBufferSizeProvider.Builder setOffloadBufferDurationUs​(int offloadBufferDurationUs)

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

    - #### 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 2.

    - #### build

          public DefaultAudioTrackBufferSizeProvider build()

      Build the `DefaultAudioTrackBufferSizeProvider`.