AudioManager.GetAudioDevicesForAttributes(AudioAttributes) Method

Definition

Get the audio devices that would be used for the routing of the given audio attributes.

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

Parameters

attributes
AudioAttributes

the AudioAttributes for which the routing is being queried

Returns

an empty list if there was an issue with the request, a list of AudioDeviceInfo otherwise (typically one device, except for duplicated paths).

Attributes

Remarks

Get the audio devices that would be used for the routing of the given audio attributes. These are the devices anticipated to play sound from an AudioTrack created with the specified AudioAttributes. The audio routing can change if audio devices are physically connected or disconnected or concurrently through AudioRouting or MediaRouter.

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