# AudioOutputProvider.FormatConfig.Builder

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/audio/AudioOutputProvider.java+class:androidx.media3.exoplayer.audio.AudioOutputProvider.FormatConfig.Builder)

*** ** * ** ***


```
class AudioOutputProvider.FormatConfig.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#Builder(androidx.media3.common.Format)(format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!)` Creates a new builder. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#build()()` Builds the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setAudioAttributes(androidx.media3.common.AudioAttributes)(audioAttributes: https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setAudioSessionId(int)(audioSessionId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the audio session ID. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setEnableHighResolutionPcmOutput(boolean)( enableHighResolutionPcmOutput: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Sets whether to enable high resolution PCM output with more than 16 bits. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setEnableOffload(boolean)(enableOffload: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether the audio output should enable offload. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setEnablePlaybackParameters(boolean)(enablePlaybackParameters: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether to control the playback parameters using the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutput` implementation. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setEnableTunneling(boolean)(enableTunneling: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets whether tunneling is enabled. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setPreferredBufferSize(int)(preferredBufferSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the preferred buffer size in bytes, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no preference is specified. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setPreferredDevice(android.media.AudioDeviceInfo)(preferredDevice: https://developer.android.com/reference/android/media/AudioDeviceInfo.html?)` Sets the preferred `https://developer.android.com/reference/android/media/AudioDeviceInfo.html`, or null for no preference. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder#setVirtualDeviceId(int)(virtualDeviceId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the virtual device ID, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET()` if not specified. |

## Public constructors

### Builder

```
Builder(format: Format!)
```

Creates a new builder.

## Public functions

### build

```
fun build(): AudioOutputProvider.FormatConfig!
```

Builds the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig`.

### setAudioAttributes

```
@CanIgnoreReturnValue
fun setAudioAttributes(audioAttributes: AudioAttributes!): AudioOutputProvider.FormatConfig.Builder!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes`.

### setAudioSessionId

```
@CanIgnoreReturnValue
fun setAudioSessionId(audioSessionId: Int): AudioOutputProvider.FormatConfig.Builder!
```

Sets the audio session ID. The default value is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#AUDIO_SESSION_ID_UNSET()`.

This parameter should not generally affect the outcome of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider#getFormatSupport(androidx.media3.exoplayer.audio.AudioOutputProvider.FormatConfig)`.

### setEnableHighResolutionPcmOutput

```
@CanIgnoreReturnValue
fun setEnableHighResolutionPcmOutput(
    enableHighResolutionPcmOutput: Boolean
): AudioOutputProvider.FormatConfig.Builder!
```

Sets whether to enable high resolution PCM output with more than 16 bits.

### setEnableOffload

```
@CanIgnoreReturnValue
fun setEnableOffload(enableOffload: Boolean): AudioOutputProvider.FormatConfig.Builder!
```

Sets whether the audio output should enable offload.

This parameter should not generally affect the outcome of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider#getFormatSupport(androidx.media3.exoplayer.audio.AudioOutputProvider.FormatConfig)`.

### setEnablePlaybackParameters

```
@CanIgnoreReturnValue
fun setEnablePlaybackParameters(enablePlaybackParameters: Boolean): AudioOutputProvider.FormatConfig.Builder!
```

Sets whether to control the playback parameters using the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutput` implementation.

This parameter should not generally affect the outcome of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider#getFormatSupport(androidx.media3.exoplayer.audio.AudioOutputProvider.FormatConfig)`.

### setEnableTunneling

```
@CanIgnoreReturnValue
fun setEnableTunneling(enableTunneling: Boolean): AudioOutputProvider.FormatConfig.Builder!
```

Sets whether tunneling is enabled.

This parameter should not generally affect the outcome of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider#getFormatSupport(androidx.media3.exoplayer.audio.AudioOutputProvider.FormatConfig)`.

### setPreferredBufferSize

```
@CanIgnoreReturnValue
fun setPreferredBufferSize(preferredBufferSize: Int): AudioOutputProvider.FormatConfig.Builder!
```

Sets the preferred buffer size in bytes, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no preference is specified.

This parameter should not generally affect the outcome of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider#getFormatSupport(androidx.media3.exoplayer.audio.AudioOutputProvider.FormatConfig)`.

### setPreferredDevice

```
@CanIgnoreReturnValue
fun setPreferredDevice(preferredDevice: AudioDeviceInfo?): AudioOutputProvider.FormatConfig.Builder!
```

Sets the preferred `https://developer.android.com/reference/android/media/AudioDeviceInfo.html`, or null for no preference.

### setVirtualDeviceId

```
@CanIgnoreReturnValue
fun setVirtualDeviceId(virtualDeviceId: Int): AudioOutputProvider.FormatConfig.Builder!
```

Sets the virtual device ID, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET()` if not specified. The default value is `https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET()`.

This parameter should not generally affect the outcome of `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider#getFormatSupport(androidx.media3.exoplayer.audio.AudioOutputProvider.FormatConfig)`.