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

*** ** * ** ***


```
@UnstableApi
public final class TrackSelectionParameters.AudioOffloadPreferences
```

<br />

*** ** * ** ***

Preferences and constraints for enabling audio offload.

## Summary

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

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#AUDIO_OFFLOAD_MODE_DISABLED() = 0` The track selector will disable audio offload on the audio sink. |
| `static final int` | `https://developer.android.com/reference/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. |
| `static final int` | `https://developer.android.com/reference/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. |
| `static final https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#DEFAULT()` Returns an instance configured with default values. |

| ### Public fields |
|---|---|
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.AudioOffloadMode https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#audioOffloadMode()` The preferred offload mode setting for audio playback. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#isGaplessSupportRequired()` A constraint on enabling offload. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#isSpeedChangeSupportRequired()` A constraint on enabling offload. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.Builder` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#buildUpon()()` Creates a new `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.Builder`, copying the initial values from this instance. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `static https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#fromBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` Construct an instance from a `https://developer.android.com/reference/android/os/Bundle.html` produced by `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#toBundle()`. |
| `int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#hashCode()()` |
| `https://developer.android.com/reference/android/os/Bundle.html` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#toBundle()()` |

## Constants

### AUDIO_OFFLOAD_MODE_DISABLED

```
public static final int AUDIO_OFFLOAD_MODE_DISABLED = 0
```

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

```
public static final int AUDIO_OFFLOAD_MODE_ENABLED = 1
```

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

### AUDIO_OFFLOAD_MODE_REQUIRED

```
public static final int AUDIO_OFFLOAD_MODE_REQUIRED = 2
```

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

```
public static final TrackSelectionParameters.AudioOffloadPreferences DEFAULT
```

Returns an instance configured with default values.

## Public fields

### audioOffloadMode

```
@TrackSelectionParameters.AudioOffloadPreferences.AudioOffloadMode
public final int audioOffloadMode
```

The preferred offload mode setting for audio playback.

### isGaplessSupportRequired

```
public final boolean isGaplessSupportRequired
```

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

```
public final boolean isSpeedChangeSupportRequired
```

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

## Public methods

### buildUpon

```
public TrackSelectionParameters.AudioOffloadPreferences.Builder buildUpon()
```

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

### equals

```
public boolean equals(@Nullable Object obj)
```

### fromBundle

```
public static TrackSelectionParameters.AudioOffloadPreferences fromBundle(Bundle bundle)
```

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

### hashCode

```
public int hashCode()
```

### toBundle

```
public Bundle toBundle()
```