Freigeben über


AudioTrack.IsDirectPlaybackSupported(AudioFormat, AudioAttributes) Method

Definition

Returns whether direct playback of an audio format with the provided attributes is currently supported on the system.

[Android.Runtime.Register("isDirectPlaybackSupported", "(Landroid/media/AudioFormat;Landroid/media/AudioAttributes;)Z", "", ApiSince=29)]
public static bool IsDirectPlaybackSupported (Android.Media.AudioFormat format, Android.Media.AudioAttributes attributes);
[<Android.Runtime.Register("isDirectPlaybackSupported", "(Landroid/media/AudioFormat;Landroid/media/AudioAttributes;)Z", "", ApiSince=29)>]
static member IsDirectPlaybackSupported : Android.Media.AudioFormat * Android.Media.AudioAttributes -> bool

Parameters

format
AudioFormat

a non-null AudioFormat instance describing the format of the audio data.

attributes
AudioAttributes

a non-null AudioAttributes instance.

Returns

true if the given audio format can be played directly.

Attributes

Remarks

Returns whether direct playback of an audio format with the provided attributes is currently supported on the system.

Direct playback means that the audio stream is not resampled or downmixed by the framework. Checking for direct support can help the app select the representation of audio content that most closely matches the capabilities of the device and peripherials (e.g. A/V receiver) connected to it. Note that the provided stream can still be re-encoded or mixed with other streams, if needed.

Also note that this query only provides information about the support of an audio format. It does not indicate whether the resources necessary for the playback are available at that instant.

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

Java documentation for android.media.AudioTrack.isDirectPlaybackSupported(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