# ExoPlayer.AudioOffloadListener

# ExoPlayer.AudioOffloadListener

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/ExoPlayer.java+class:androidx.media3.exoplayer.ExoPlayer.AudioOffloadListener)

*** ** * ** ***

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

<br />

```
@UnstableApi
interface ExoPlayer.AudioOffloadListener
```

<br />

*** ** * ** ***

A listener for audio offload events.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onOffloadedPlayback](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.AudioOffloadListener#onOffloadedPlayback(boolean))`(isOffloadedPlayback: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when the value of[isOffloadedPlayback](https://developer.android.com/reference/android/media/AudioTrack.html#isOffloadedPlayback())changes.                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onSleepingForOffloadChanged](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer.AudioOffloadListener#onSleepingForOffloadChanged(boolean))`(isSleepingForOffload: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Called when the value of[isSleepingForOffload](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#isSleepingForOffload())changes. |

## Public functions

### onOffloadedPlayback

```
fun onOffloadedPlayback(isOffloadedPlayback: Boolean): Unit
```

Called when the value of[isOffloadedPlayback](https://developer.android.com/reference/android/media/AudioTrack.html#isOffloadedPlayback())changes.

This should not be generally required to be acted upon. But when offload is critical for efficiency, or audio features (gapless, playback speed), this will let the app know.  

### onSleepingForOffloadChanged

```
fun onSleepingForOffloadChanged(isSleepingForOffload: Boolean): Unit
```

Called when the value of[isSleepingForOffload](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#isSleepingForOffload())changes.

When`isSleepingForOffload`is`true`then, the player has paused its main loop to save power in offload scheduling mode.