Partager via


AudioManager.GetPlaybackOffloadSupport(AudioFormat, AudioAttributes) Method

Definition

Returns whether offloaded playback of an audio format is supported on the device or not and when supported whether gapless transitions are possible or not.

[Android.Runtime.Register("getPlaybackOffloadSupport", "(Landroid/media/AudioFormat;Landroid/media/AudioAttributes;)I", "", ApiSince=31)]
public static int GetPlaybackOffloadSupport (Android.Media.AudioFormat format, Android.Media.AudioAttributes attributes);
[<Android.Runtime.Register("getPlaybackOffloadSupport", "(Landroid/media/AudioFormat;Landroid/media/AudioAttributes;)I", "", ApiSince=31)>]
static member GetPlaybackOffloadSupport : Android.Media.AudioFormat * Android.Media.AudioAttributes -> int

Parameters

format
AudioFormat

the audio format (codec, sample rate, channels) being checked.

attributes
AudioAttributes

the AudioAttributes to be used for playback

Returns

#PLAYBACK_OFFLOAD_NOT_SUPPORTED if offload playback if not supported, #PLAYBACK_OFFLOAD_SUPPORTED if offload playback is supported or #PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED if gapless transitions are also supported.

Attributes

Remarks

Returns whether offloaded playback of an audio format is supported on the device or not and when supported whether gapless transitions are possible or not.

Offloaded playback is the feature where the decoding and playback of an audio stream is not competing with other software resources. In general, it is supported by dedicated hardware, such as audio DSPs.

Note that this query only provides information about the support of an audio format, it does not indicate whether the resources necessary for the offloaded playback are available at that instant.

This member is deprecated. Use #getDirectPlaybackSupport(AudioFormat, AudioAttributes) instead

Java documentation for android.media.AudioManager.getPlaybackOffloadSupport(android.media.AudioFormat, android.media.AudioAttributes).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to