# 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)

*** ** * ** ***


```
public final class AudioOutputProvider.FormatConfig.Builder
```

<br />

*** ** * ** ***

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

## Summary

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

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

## Public constructors

### Builder

```
public Builder(Format format)
```

Creates a new builder.

## Public methods

### build

```
public AudioOutputProvider.FormatConfig build()
```

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

### setAudioAttributes

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setAudioAttributes(AudioAttributes audioAttributes)
```

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

### setAudioSessionId

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setAudioSessionId(int audioSessionId)
```

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

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

### setEnableHighResolutionPcmOutput

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setEnableHighResolutionPcmOutput(
    boolean enableHighResolutionPcmOutput
)
```

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

### setEnableOffload

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setEnableOffload(boolean enableOffload)
```

Sets whether the audio output should enable offload.

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

### setEnablePlaybackParameters

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setEnablePlaybackParameters(boolean enablePlaybackParameters)
```

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

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

### setEnableTunneling

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setEnableTunneling(boolean enableTunneling)
```

Sets whether tunneling is enabled.

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

### setPreferredBufferSize

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setPreferredBufferSize(int preferredBufferSize)
```

Sets the preferred buffer size in bytes, or `https://developer.android.com/reference/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/androidx/media3/exoplayer/audio/AudioOutputProvider#getFormatSupport(androidx.media3.exoplayer.audio.AudioOutputProvider.FormatConfig)`.

### setPreferredDevice

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setPreferredDevice(@Nullable AudioDeviceInfo preferredDevice)
```

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

### setVirtualDeviceId

```
@CanIgnoreReturnValue
public AudioOutputProvider.FormatConfig.Builder setVirtualDeviceId(int virtualDeviceId)
```

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

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