# TrackSelectionParameters.AudioOffloadPreferences

# TrackSelectionParameters.AudioOffloadPreferences

Artifact:[androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/common/TrackSelectionParameters.java+class:androidx.media3.common.TrackSelectionParameters.AudioOffloadPreferences)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences "View this page in Java")

<br />

```
@UnstableApi
class TrackSelectionParameters.AudioOffloadPreferences
```

<br />

*** ** * ** ***

Preferences and constraints for enabling audio offload.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Nested types                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `@`[Documented](https://developer.android.com/reference/java/lang/annotation/Documented.html) `@`[Retention](https://developer.android.com/reference/java/lang/annotation/Retention.html)`(value = `[RetentionPolicy.SOURCE](https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE)`)` `@`[Target](https://developer.android.com/reference/java/lang/annotation/Target.html)`(value = `[ElementType.TYPE_USE](https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE)`)` `@`[IntDef](https://developer.android.com/reference/kotlin/androidx/annotation/IntDef)`(value = )` `annotation `[TrackSelectionParameters.AudioOffloadPreferences.AudioOffloadMode](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.AudioOffloadMode) The preference level for enabling audio offload on the audio sink. |
| `class `[TrackSelectionParameters.AudioOffloadPreferences.Builder](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.Builder) A builder for[AudioOffloadPreferences](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

|                                                                                     ### Constants                                                                                     |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | [AUDIO_OFFLOAD_MODE_DISABLED](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#AUDIO_OFFLOAD_MODE_DISABLED())` = 0` The track selector will disable audio offload on the audio sink.                                                                      |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | [AUDIO_OFFLOAD_MODE_ENABLED](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#AUDIO_OFFLOAD_MODE_ENABLED())` = 1` The track selector will enable audio offload if the selected tracks and renderer capabilities are compatible.                           |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                   | [AUDIO_OFFLOAD_MODE_REQUIRED](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#AUDIO_OFFLOAD_MODE_REQUIRED())` = 2` The track selector will only select tracks that with the renderer capabilities provide an audio offload compatible playback scenario. |
| `const `[TrackSelectionParameters.AudioOffloadPreferences](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences)`!` | [DEFAULT](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#DEFAULT()) Returns an instance configured with default values.                                                                                                                                 |

|                                                                                     ### Public functions                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TrackSelectionParameters.AudioOffloadPreferences.Builder](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.Builder)`!` | [buildUpon](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#buildUpon())`()` Creates a new[AudioOffloadPreferences.Builder](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.Builder), copying the initial values from this instance.                                                                                                                                      |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                           | [equals](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#equals(java.lang.Object))`(obj: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                                                                                                                                                        |
| `java-static `[TrackSelectionParameters.AudioOffloadPreferences](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences)`!`   | [fromBundle](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#fromBundle(android.os.Bundle))`(bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`!)` Construct an instance from a[Bundle](https://developer.android.com/reference/android/os/Bundle.html)produced by[toBundle](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#toBundle()). |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                   | [hashCode](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#hashCode())`()`                                                                                                                                                                                                                                                                                                                                                                       |
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html)`!`                                                                                                                   | [toBundle](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#toBundle())`()`                                                                                                                                                                                                                                                                                                                                                                       |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | `@`[TrackSelectionParameters.AudioOffloadPreferences.AudioOffloadMode](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.AudioOffloadMode) [audioOffloadMode](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#audioOffloadMode()) The preferred offload mode setting for audio playback. |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isGaplessSupportRequired](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#isGaplessSupportRequired()) A constraint on enabling offload.                                                                                                                                                                                                                      |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isSpeedChangeSupportRequired](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#isSpeedChangeSupportRequired()) A constraint on enabling offload.                                                                                                                                                                                                              |

## Constants

### AUDIO_OFFLOAD_MODE_DISABLED

```
const val AUDIO_OFFLOAD_MODE_DISABLED = 0: Int
```

The track selector will disable audio offload on the audio sink. Track selection will not take into consideration whether or not a track is offload compatible.  

### AUDIO_OFFLOAD_MODE_ENABLED

```
const val AUDIO_OFFLOAD_MODE_ENABLED = 1: Int
```

The track selector will enable audio offload if the selected tracks and renderer capabilities are compatible.  

### AUDIO_OFFLOAD_MODE_REQUIRED

```
const val AUDIO_OFFLOAD_MODE_REQUIRED = 2: Int
```

The track selector will only select tracks that with the renderer capabilities provide an audio offload compatible playback scenario. If it is impossible to create an offload-compatible track selection, then no tracks will be selected.  

### DEFAULT

```
const val DEFAULT: TrackSelectionParameters.AudioOffloadPreferences!
```

Returns an instance configured with default values.  

## Public functions

### buildUpon

```
fun buildUpon(): TrackSelectionParameters.AudioOffloadPreferences.Builder!
```

Creates a new[AudioOffloadPreferences.Builder](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.Builder), copying the initial values from this instance.  

### equals

```
fun equals(obj: Any?): Boolean
```  

### fromBundle

```
java-static fun fromBundle(bundle: Bundle!): TrackSelectionParameters.AudioOffloadPreferences!
```

Construct an instance from a[Bundle](https://developer.android.com/reference/android/os/Bundle.html)produced by[toBundle](https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#toBundle()).  

### hashCode

```
fun hashCode(): Int
```  

### toBundle

```
fun toBundle(): Bundle!
```  

## Public properties

### audioOffloadMode

```
@TrackSelectionParameters.AudioOffloadPreferences.AudioOffloadMode
val audioOffloadMode: Int
```

The preferred offload mode setting for audio playback.  

### isGaplessSupportRequired

```
val isGaplessSupportRequired: Boolean
```

A constraint on enabling offload. If`true`, then audio offload will be enabled only if the device supports gapless transitions during offload or the selected audio is not gapless.  

### isSpeedChangeSupportRequired

```
val isSpeedChangeSupportRequired: Boolean
```

A constraint on enabling offload. If`true`, then audio offload will be enabled only if the device supports changing playback speed during offload.