AudioManager.GetDirectProfilesForAttributes(AudioAttributes) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
).
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.