Package com.google.android.exoplayer2.audio

## Class AudioAttributes.Builder

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

- Enclosing class:
    AudioAttributes

      public static final class AudioAttributes.Builder
      extends Object

  Builder for `AudioAttributes`.

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `AudioAttributes` | `build()` | Creates an `AudioAttributes` instance from this builder.
    `AudioAttributes.Builder` | `setAllowedCapturePolicy​(int allowedCapturePolicy)` | See `AudioAttributes.Builder.setAllowedCapturePolicy(int)`.
    `AudioAttributes.Builder` | `setContentType​(int contentType)` |
    `AudioAttributes.Builder` | `setFlags​(int flags)` |
    `AudioAttributes.Builder` | `setUsage​(int usage)` |

    - ### 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 for `AudioAttributes`.

      By default the content type is `C.CONTENT_TYPE_UNKNOWN`, usage is `C.USAGE_MEDIA`, capture policy is `C.ALLOW_CAPTURE_BY_ALL` and no flags are set.

  - ### Method Detail

    - #### setContentType

          public AudioAttributes.Builder setContentType​(@AudioContentType
                                                        int contentType)

      See Also:
        `AudioAttributes.Builder.setContentType(int)`

    - #### setFlags

          public AudioAttributes.Builder setFlags​(@AudioFlags
                                                  int flags)

      See Also:
        `AudioAttributes.Builder.setFlags(int)`

    - #### setUsage

          public AudioAttributes.Builder setUsage​(@AudioUsage
                                                  int usage)

      See Also:
        `AudioAttributes.Builder.setUsage(int)`

    - #### setAllowedCapturePolicy

          public AudioAttributes.Builder setAllowedCapturePolicy​(@AudioAllowedCapturePolicy
                                                                 int allowedCapturePolicy)

      See `AudioAttributes.Builder.setAllowedCapturePolicy(int)`.

    - #### build

          public AudioAttributes build()

      Creates an `AudioAttributes` instance from this builder.