AudioDeviceInfo
  public
  
  final
  
  class
  AudioDeviceInfo
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.media.AudioDeviceInfo | 
Provides information about an audio device.
Summary
| Constants | |
|---|---|
| int | TYPE_AUX_LINEA device type describing the auxiliary line-level connectors. | 
| int | TYPE_BLE_BROADCASTA device type describing a Bluetooth Low Energy (BLE) broadcast group. | 
| int | TYPE_BLE_HEADSETA device type describing a Bluetooth Low Energy (BLE) audio headset or headphones. | 
| int | TYPE_BLE_SPEAKERA device type describing a Bluetooth Low Energy (BLE) audio speaker. | 
| int | TYPE_BLUETOOTH_A2DPA device type describing a Bluetooth device supporting the A2DP profile. | 
| int | TYPE_BLUETOOTH_SCOA device type describing a Bluetooth device typically used for telephony. | 
| int | TYPE_BUILTIN_EARPIECEA device type describing the attached earphone speaker. | 
| int | TYPE_BUILTIN_MICA device type describing the microphone(s) built in a device. | 
| int | TYPE_BUILTIN_SPEAKERA device type describing the speaker system (i.e. | 
| int | TYPE_BUILTIN_SPEAKER_SAFEA device type describing the speaker system (i.e. | 
| int | TYPE_BUSA type-agnostic device used for communication with external audio systems | 
| int | TYPE_DOCKA device type describing the audio device associated with a dock. | 
| int | TYPE_DOCK_ANALOGA device type describing the audio device associated with a dock using an analog connection. | 
| int | TYPE_FMA device type associated with the transmission of audio signals over FM. | 
| int | TYPE_FM_TUNERA device type for accessing the audio content transmitted over FM. | 
| int | TYPE_HDMIA device type describing an HDMI connection . | 
| int | TYPE_HDMI_ARCA device type describing the Audio Return Channel of an HDMI connection. | 
| int | TYPE_HDMI_EARCA device type describing the Enhanced Audio Return Channel of an HDMI connection. | 
| int | TYPE_HEARING_AIDA device type describing a Hearing Aid. | 
| int | TYPE_IPA device type connected over IP. | 
| int | TYPE_LINE_ANALOGA device type describing an analog line-level connection. | 
| int | TYPE_LINE_DIGITALA device type describing a digital line connection (e.g. SPDIF). | 
| int | TYPE_MULTICHANNEL_GROUPA device type describing a speaker group that supports multichannel contents. | 
| int | TYPE_REMOTE_SUBMIXA device type for rerouting audio within the Android framework between mixes and system applications. | 
| int | TYPE_TELEPHONYA device type describing the transmission of audio signals over the telephony network. | 
| int | TYPE_TV_TUNERA device type for accessing the audio content transmitted over the TV tuner system. | 
| int | TYPE_UNKNOWNA device type associated with an unknown or uninitialized device. | 
| int | TYPE_USB_ACCESSORYA device type describing a USB audio device in accessory mode. | 
| int | TYPE_USB_DEVICEA device type describing a USB audio device. | 
| int | TYPE_USB_HEADSETA device type describing a USB audio headset. | 
| int | TYPE_WIRED_HEADPHONESA device type describing a pair of wired headphones. | 
| int | TYPE_WIRED_HEADSETA device type describing a headset, which is the combination of a headphones and microphone. | 
| Public methods | |
|---|---|
| 
        
        
        
        
        
        boolean | 
      equals(Object o)
      Indicates whether some other object is "equal to" this one. | 
| 
        
        
        
        
        
        String | 
      getAddress()
       | 
| 
        
        
        
        
        
        List<AudioDescriptor> | 
      getAudioDescriptors()
       | 
| 
        
        
        
        
        
        List<AudioProfile> | 
      getAudioProfiles()
       | 
| 
        
        
        
        
        
        int[] | 
      getChannelCounts()
       | 
| 
        
        
        
        
        
        int[] | 
      getChannelIndexMasks()
       | 
| 
        
        
        
        
        
        int[] | 
      getChannelMasks()
       | 
| 
        
        
        
        
        
        int[] | 
      getEncapsulationMetadataTypes()
      Returns an array of supported encapsulation metadata types for the device. | 
| 
        
        
        
        
        
        int[] | 
      getEncapsulationModes()
      Returns an array of supported encapsulation modes for the device. | 
| 
        
        
        
        
        
        int[] | 
      getEncodings()
       | 
| 
        
        
        
        
        
        int | 
      getId()
       | 
| 
        
        
        
        
        
        CharSequence | 
      getProductName()
       | 
| 
        
        
        
        
        
        int[] | 
      getSampleRates()
       | 
| 
        
        
        
        
        
        int | 
      getSpeakerLayoutChannelMask()
       | 
| 
        
        
        
        
        
        int | 
      getType()
       | 
| 
        
        
        
        
        
        int | 
      hashCode()
      Returns a hash code value for the object. | 
| 
        
        
        
        
        
        boolean | 
      isSink()
       | 
| 
        
        
        
        
        
        boolean | 
      isSource()
       | 
| 
        
        
        
        
        
        String | 
      toString()
      Returns a string representation of the object. | 
| Inherited methods | |
|---|---|
Constants
TYPE_AUX_LINE
public static final int TYPE_AUX_LINE
A device type describing the auxiliary line-level connectors.
Constant Value: 19 (0x00000013)
TYPE_BLE_BROADCAST
public static final int TYPE_BLE_BROADCAST
A device type describing a Bluetooth Low Energy (BLE) broadcast group.
Constant Value: 30 (0x0000001e)
TYPE_BLE_HEADSET
public static final int TYPE_BLE_HEADSET
A device type describing a Bluetooth Low Energy (BLE) audio headset or headphones. Headphones are grouped with headsets when the device is a sink: the features of headsets and headphones with regard to playback are the same.
Constant Value: 26 (0x0000001a)
TYPE_BLE_SPEAKER
public static final int TYPE_BLE_SPEAKER
A device type describing a Bluetooth Low Energy (BLE) audio speaker.
Constant Value: 27 (0x0000001b)
TYPE_BLUETOOTH_A2DP
public static final int TYPE_BLUETOOTH_A2DP
A device type describing a Bluetooth device supporting the A2DP profile.
Constant Value: 8 (0x00000008)
TYPE_BLUETOOTH_SCO
public static final int TYPE_BLUETOOTH_SCO
A device type describing a Bluetooth device typically used for telephony.
Constant Value: 7 (0x00000007)
TYPE_BUILTIN_EARPIECE
public static final int TYPE_BUILTIN_EARPIECE
A device type describing the attached earphone speaker.
Constant Value: 1 (0x00000001)
TYPE_BUILTIN_MIC
public static final int TYPE_BUILTIN_MIC
A device type describing the microphone(s) built in a device.
Constant Value: 15 (0x0000000f)
TYPE_BUILTIN_SPEAKER
public static final int TYPE_BUILTIN_SPEAKER
A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built in a device.
Constant Value: 2 (0x00000002)
TYPE_BUILTIN_SPEAKER_SAFE
public static final int TYPE_BUILTIN_SPEAKER_SAFE
A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built in a device, that is specifically tuned for outputting sounds like notifications and alarms (i.e. sounds the user couldn't necessarily anticipate).
Note that this physical audio device may be the same as TYPE_BUILTIN_SPEAKER
 but is driven differently to safely accommodate the different use case.
Constant Value: 24 (0x00000018)
TYPE_BUS
public static final int TYPE_BUS
A type-agnostic device used for communication with external audio systems
Constant Value: 21 (0x00000015)
TYPE_DOCK
public static final int TYPE_DOCK
A device type describing the audio device associated with a dock.
 Starting at API 34, this device type only represents digital docks, while docks with an
 analog connection are represented with TYPE_DOCK_ANALOG.
See also:
Constant Value: 13 (0x0000000d)
TYPE_DOCK_ANALOG
public static final int TYPE_DOCK_ANALOG
A device type describing the audio device associated with a dock using an analog connection.
Constant Value: 31 (0x0000001f)
TYPE_FM
public static final int TYPE_FM
A device type associated with the transmission of audio signals over FM.
Constant Value: 14 (0x0000000e)
TYPE_FM_TUNER
public static final int TYPE_FM_TUNER
A device type for accessing the audio content transmitted over FM.
Constant Value: 16 (0x00000010)
TYPE_HDMI
public static final int TYPE_HDMI
A device type describing an HDMI connection .
Constant Value: 9 (0x00000009)
TYPE_HDMI_ARC
public static final int TYPE_HDMI_ARC
A device type describing the Audio Return Channel of an HDMI connection.
Constant Value: 10 (0x0000000a)
TYPE_HDMI_EARC
public static final int TYPE_HDMI_EARC
A device type describing the Enhanced Audio Return Channel of an HDMI connection.
Constant Value: 29 (0x0000001d)
TYPE_HEARING_AID
public static final int TYPE_HEARING_AID
A device type describing a Hearing Aid.
Constant Value: 23 (0x00000017)
TYPE_IP
public static final int TYPE_IP
A device type connected over IP.
Constant Value: 20 (0x00000014)
TYPE_LINE_ANALOG
public static final int TYPE_LINE_ANALOG
A device type describing an analog line-level connection.
Constant Value: 5 (0x00000005)
TYPE_LINE_DIGITAL
public static final int TYPE_LINE_DIGITAL
A device type describing a digital line connection (e.g. SPDIF).
Constant Value: 6 (0x00000006)
TYPE_MULTICHANNEL_GROUP
public static final int TYPE_MULTICHANNEL_GROUP
A device type describing a speaker group that supports multichannel contents. The speakers in the group are connected together using local network based protocols. The speaker group requires additional input of the physical positions of each individual speaker to provide a better experience on multichannel contents.
Constant Value: 32 (0x00000020)
TYPE_REMOTE_SUBMIX
public static final int TYPE_REMOTE_SUBMIX
A device type for rerouting audio within the Android framework between mixes and
 system applications.
 This type is for instance encountered when querying the output device of a track
 (with AudioTrack.getRoutedDevice() playing from a device in screen mirroring mode,
 where the audio is not heard on the device, but on the remote device.
Constant Value: 25 (0x00000019)
TYPE_TELEPHONY
public static final int TYPE_TELEPHONY
A device type describing the transmission of audio signals over the telephony network.
Constant Value: 18 (0x00000012)
TYPE_TV_TUNER
public static final int TYPE_TV_TUNER
A device type for accessing the audio content transmitted over the TV tuner system.
Constant Value: 17 (0x00000011)
TYPE_UNKNOWN
public static final int TYPE_UNKNOWN
A device type associated with an unknown or uninitialized device.
Constant Value: 0 (0x00000000)
TYPE_USB_ACCESSORY
public static final int TYPE_USB_ACCESSORY
A device type describing a USB audio device in accessory mode.
Constant Value: 12 (0x0000000c)
TYPE_USB_DEVICE
public static final int TYPE_USB_DEVICE
A device type describing a USB audio device.
Constant Value: 11 (0x0000000b)
TYPE_USB_HEADSET
public static final int TYPE_USB_HEADSET
A device type describing a USB audio headset.
Constant Value: 22 (0x00000016)
TYPE_WIRED_HEADPHONES
public static final int TYPE_WIRED_HEADPHONES
A device type describing a pair of wired headphones.
Constant Value: 4 (0x00000004)
TYPE_WIRED_HEADSET
public static final int TYPE_WIRED_HEADSET
A device type describing a headset, which is the combination of a headphones and microphone.
Constant Value: 3 (0x00000003)
Public methods
equals
public boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
 The equals method implements an equivalence relation
 on non-null object references:
 
- It is reflexive: for any non-null reference value
     x,x.equals(x)should returntrue.
- It is symmetric: for any non-null reference values
     xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue.
- It is transitive: for any non-null reference values
     x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue.
- It is consistent: for any non-null reference values
     xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified.
- For any non-null reference value x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| Parameters | |
|---|---|
| o | Object: the reference object with which to compare. | 
| Returns | |
|---|---|
| boolean | trueif this object is the same as the obj
          argument;falseotherwise. | 
getAddress
public String getAddress ()
| Returns | |
|---|---|
| String | The "address" string of the device. This generally contains device-specific
 parameters.
 This value cannot be null. | 
getAudioDescriptors
public List<AudioDescriptor> getAudioDescriptors ()
| Returns | |
|---|---|
| List<AudioDescriptor> | A list of AudioDescriptorsupported by the audio devices.
 This value cannot benull. | 
getAudioProfiles
public List<AudioProfile> getAudioProfiles ()
| Returns | |
|---|---|
| List<AudioProfile> | A list of AudioProfilesupported by the audio devices.
 This value cannot benull. | 
getChannelCounts
public int[] getChannelCounts ()
| Returns | |
|---|---|
| int[] | An array of channel counts (1, 2, 4, ...) for which this audio device
 can be configured.
 Note: an empty array indicates that the device supports arbitrary channel counts.
 This value cannot be null. | 
getChannelIndexMasks
public int[] getChannelIndexMasks ()
| Returns | |
|---|---|
| int[] | An array of channel index masks for which this audio device can be configured.
 This value cannot be null. | 
getChannelMasks
public int[] getChannelMasks ()
| Returns | |
|---|---|
| int[] | An array of channel position masks (e.g. AudioFormat.CHANNEL_IN_STEREO,AudioFormat.CHANNEL_OUT_7POINT1) for which this audio device can be configured.
 This value cannot benull. | 
getEncapsulationMetadataTypes
public int[] getEncapsulationMetadataTypes ()
Returns an array of supported encapsulation metadata types for the device.
 The metadata type returned should be allowed for all encapsulation modes supported
 by the device.  Some metadata types may apply only to certain
 compressed stream formats, the returned list is the union of subsets.
 The array can include any of
 AudioTrack.ENCAPSULATION_METADATA_TYPE_FRAMEWORK_TUNER,
 AudioTrack.ENCAPSULATION_METADATA_TYPE_DVB_AD_DESCRIPTOR.
| Returns | |
|---|---|
| int[] | An array of supported encapsulation metadata types for the device.  This
     may be an empty array if no metadata types are supported.
 This value cannot be null.
 Value is android.media.AudioTrack.ENCAPSULATION_METADATA_TYPE_NONE,AudioTrack.ENCAPSULATION_METADATA_TYPE_FRAMEWORK_TUNER,AudioTrack.ENCAPSULATION_METADATA_TYPE_DVB_AD_DESCRIPTOR, orAudioTrack.ENCAPSULATION_METADATA_TYPE_SUPPLEMENTARY_AUDIO_PLACEMENT | 
getEncapsulationModes
public int[] getEncapsulationModes ()
Returns an array of supported encapsulation modes for the device.
 The array can include any of the AudioTrack encapsulation modes,
 e.g. AudioTrack.ENCAPSULATION_MODE_ELEMENTARY_STREAM.
| Returns | |
|---|---|
| int[] | An array of supported encapsulation modes for the device.  This
     may be an empty array if no encapsulation modes are supported.
 This value cannot be null.
 Value isAudioTrack.ENCAPSULATION_MODE_NONE, orAudioTrack.ENCAPSULATION_MODE_ELEMENTARY_STREAM | 
getEncodings
public int[] getEncodings ()
| Returns | |
|---|---|
| int[] | An array of audio encodings (e.g. AudioFormat.ENCODING_PCM_16BIT,AudioFormat.ENCODING_PCM_FLOAT) supported by the audio device.ENCODING_PCM_FLOATindicates the device supports more
 than 16 bits of integer precision.  As there is no AudioFormat constant
 specifically defined for 24-bit PCM, the valueENCODING_PCM_FLOATindicates thatAudioTrackorAudioRecordcan preserve at least 24 bits of
 integer precision to that device.
 This value cannot benull. | 
getProductName
public CharSequence getProductName ()
| Returns | |
|---|---|
| CharSequence | The human-readable name of the audio device. | 
getSampleRates
public int[] getSampleRates ()
| Returns | |
|---|---|
| int[] | An array of sample rates supported by the audio device.
 Note: an empty array indicates that the device supports arbitrary rates.
 This value cannot be null. | 
getSpeakerLayoutChannelMask
public int getSpeakerLayoutChannelMask ()
See also:
getType
public int getType ()
| Returns | |
|---|---|
| int | The device type identifier of the audio device (i.e. TYPE_BUILTIN_SPEAKER).
 Value is TYPE_BUILTIN_EARPIECE,TYPE_BUILTIN_SPEAKER,TYPE_WIRED_HEADSET,TYPE_WIRED_HEADPHONES,TYPE_BLUETOOTH_SCO,TYPE_BLUETOOTH_A2DP,TYPE_HDMI,TYPE_DOCK,TYPE_USB_ACCESSORY,TYPE_USB_DEVICE,TYPE_USB_HEADSET,TYPE_TELEPHONY,TYPE_LINE_ANALOG,TYPE_HDMI_ARC,TYPE_HDMI_EARC,TYPE_LINE_DIGITAL,TYPE_FM,TYPE_AUX_LINE,TYPE_IP,TYPE_BUS,TYPE_HEARING_AID,TYPE_BUILTIN_MIC,TYPE_FM_TUNER,TYPE_TV_TUNER,TYPE_BUILTIN_SPEAKER_SAFE,TYPE_REMOTE_SUBMIX,TYPE_BLE_HEADSET,TYPE_BLE_SPEAKER, android.media.AudioDeviceInfo.TYPE_ECHO_REFERENCE,TYPE_BLE_BROADCAST,TYPE_DOCK_ANALOG, orTYPE_MULTICHANNEL_GROUP | 
hashCode
public int hashCode ()
Returns a hash code value for the object. This method is
 supported for the benefit of hash tables such as those provided by
 HashMap.
 
 The general contract of hashCode is:
 
- Whenever it is invoked on the same object more than once during
     an execution of a Java application, the hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the equalsmethod, then calling thehashCodemethod on each of the two objects must produce the same integer result.
- It is not required that if two objects are unequal
     according to the equalsmethod, then calling thehashCodemethod on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
| Returns | |
|---|---|
| int | a hash code value for this object. | 
isSink
public boolean isSink ()
| Returns | |
|---|---|
| boolean | true if the audio device is a sink for audio data (i.e. an output). | 
isSource
public boolean isSource ()
| Returns | |
|---|---|
| boolean | true if the audio device is a source for audio data (e.e an input). | 
toString
public String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
| String | a string representation of the object. | 
