Share via


AudioManager.GetDirectProfilesForAttributes(AudioAttributes) Method

Definition

Returns a list of direct AudioProfile that are supported for the specified AudioAttributes.

[Android.Runtime.Register("getDirectProfilesForAttributes", "(Landroid/media/AudioAttributes;)Ljava/util/List;", "GetGetDirectProfilesForAttributes_Landroid_media_AudioAttributes_Handler", ApiSince=33)]
public virtual System.Collections.Generic.IList<Android.Media.AudioProfile> GetDirectProfilesForAttributes (Android.Media.AudioAttributes attributes);
[<Android.Runtime.Register("getDirectProfilesForAttributes", "(Landroid/media/AudioAttributes;)Ljava/util/List;", "GetGetDirectProfilesForAttributes_Landroid_media_AudioAttributes_Handler", ApiSince=33)>]
abstract member GetDirectProfilesForAttributes : Android.Media.AudioAttributes -> System.Collections.Generic.IList<Android.Media.AudioProfile>
override this.GetDirectProfilesForAttributes : Android.Media.AudioAttributes -> System.Collections.Generic.IList<Android.Media.AudioProfile>

Parameters

attributes
AudioAttributes

a non-null AudioAttributes instance.

Returns

a list of AudioProfile

Attributes

Remarks

Returns a list of direct AudioProfile that are supported for the specified AudioAttributes. This can be empty in case of an error or if no direct playback is possible.

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 peripherals (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.

When using this information to inform your application which audio format to play, query again whenever audio output devices change (see AudioDeviceCallback).

Java documentation for android.media.AudioManager.getDirectProfilesForAttributes(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