In version 1.1 (and backwards) there was an option to offload audio with .setEnableAudiOffload
in Exoplayer.Builder
.
In version 1.2 they removed it and they only mentioned this:
Offload can be enabled through setAudioOffloadPreference in
TrackSelectionParameters
. If the set preference is to enable, the device supports offload for the format, and the track selection is a single audio track, then audio offload will be enabled.
But how and where do we use TrackSelectionParameters
? Remains unclear to me.
Don't know if this is the right solution, but I found an API like this:
exoPlayer.trackSelectionParameters = exoPlayer.trackSelectionParameters
.buildUpon()
.setAudioOffloadPreferences(
AudioOffloadPreferences
.Builder()
.setAudioOffloadMode(AudioOffloadPreferences.AUDIO_OFFLOAD_MODE_ENABLED)
.build()
)
.build()