# AudioOutputProvider.FormatConfig

# AudioOutputProvider.FormatConfig

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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig "View this page in Java")

<br />

```
class AudioOutputProvider.FormatConfig
```

<br />

*** ** * ** ***

Configuration for an audio format and its output preferences.

## Summary

|                                                                                                                                                         ### Nested types                                                                                                                                                         |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[AudioOutputProvider.FormatConfig.Builder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder) Builder for[FormatConfig](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig)instances. |

|                                                                          ### Public functions                                                                          |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AudioOutputProvider.FormatConfig.Builder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder)`!` | [buildUpon](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#buildUpon())`()` Returns a[Builder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder)initialized with the values of this instance. |

|                                            ### Public properties                                            |
|-------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AudioAttributes](https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes)`!` | [audioAttributes](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#audioAttributes()) The[AudioAttributes](https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes)to use for playback.                                                    |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                 | [audioSessionId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#audioSessionId()) The audio session ID, or[AUDIO_SESSION_ID_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#AUDIO_SESSION_ID_UNSET())if not set.                        |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | [enableHighResolutionPcmOutput](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#enableHighResolutionPcmOutput()) Sets whether to enable high resolution PCM output with more than 16 bits.                                                                              |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | [enableOffload](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#enableOffload()) Whether the audio output should enable offload.                                                                                                                                        |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | [enablePlaybackParameters](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#enablePlaybackParameters()) Whether to control the playback speed using the audio output.                                                                                                    |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                         | [enableTunneling](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#enableTunneling()) Whether tunneling is enabled.                                                                                                                                                      |
| [Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!`                   | [format](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#format()) The[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)of the audio.                                                                                               |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                 | [preferredBufferSize](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#preferredBufferSize()) The preferred buffer size in bytes, or[LENGTH_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET())if no preference is specified. |
| [AudioDeviceInfo](https://developer.android.com/reference/android/media/AudioDeviceInfo.html)`?`            | [preferredDevice](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#preferredDevice()) The preferred[AudioDeviceInfo](https://developer.android.com/reference/android/media/AudioDeviceInfo.html)for audio output, or null for no preference.                             |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                 | [virtualDeviceId](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig#virtualDeviceId()) The virtual device ID, or[INDEX_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET())if not specified.                                     |

## Public functions

### buildUpon

```
fun buildUpon(): AudioOutputProvider.FormatConfig.Builder!
```

Returns a[Builder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioOutputProvider.FormatConfig.Builder)initialized with the values of this instance.  

## Public properties

### audioAttributes

```
val audioAttributes: AudioAttributes!
```

The[AudioAttributes](https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes)to use for playback.  

### audioSessionId

```
val audioSessionId: Int
```

The audio session ID, or[AUDIO_SESSION_ID_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#AUDIO_SESSION_ID_UNSET())if not set.

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

### enableHighResolutionPcmOutput

```
val enableHighResolutionPcmOutput: Boolean
```

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

### enableOffload

```
val enableOffload: Boolean
```

Whether the audio output should enable offload.

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

### enablePlaybackParameters

```
val enablePlaybackParameters: Boolean
```

Whether to control the playback speed using the audio output.

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

### enableTunneling

```
val enableTunneling: Boolean
```

Whether tunneling is enabled.

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

### format

```
val format: Format!
```

The[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)of the audio.  

### preferredBufferSize

```
val preferredBufferSize: Int
```

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

### preferredDevice

```
val preferredDevice: AudioDeviceInfo?
```

The preferred[AudioDeviceInfo](https://developer.android.com/reference/android/media/AudioDeviceInfo.html)for audio output, or null for no preference.  

### virtualDeviceId

```
val virtualDeviceId: Int
```

The virtual device ID, or[INDEX_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET())if not specified.

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