AudioDeviceInfo
class AudioDeviceInfo
kotlin.Any | |
↳ | android.media.AudioDeviceInfo |
Provides information about an audio device.
Summary
Constants | |
---|---|
static Int |
A device type describing the auxiliary line-level connectors. |
static Int |
A device type describing a Bluetooth Low Energy (BLE) broadcast group. |
static Int |
A device type describing a Bluetooth Low Energy (BLE) audio headset or headphones. |
static Int |
A device type describing a Bluetooth Low Energy (BLE) audio speaker. |
static Int |
A device type describing a Bluetooth device supporting the A2DP profile. |
static Int |
A device type describing a Bluetooth device typically used for telephony. |
static Int |
A device type describing the attached earphone speaker. |
static Int |
A device type describing the microphone(s) built in a device. |
static Int |
A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built in a device. |
static Int |
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). |
static Int |
A type-agnostic device used for communication with external audio systems |
static Int |
A device type describing the audio device associated with a dock. |
static Int |
A device type describing the audio device associated with a dock using an analog connection. |
static Int |
A device type associated with the transmission of audio signals over FM. |
static Int |
A device type for accessing the audio content transmitted over FM. |
static Int |
A device type describing an HDMI connection . |
static Int |
A device type describing the Audio Return Channel of an HDMI connection. |
static Int |
A device type describing the Enhanced Audio Return Channel of an HDMI connection. |
static Int |
A device type describing a Hearing Aid. |
static Int |
A device type connected over IP. |
static Int |
A device type describing an analog line-level connection. |
static Int |
A device type describing a digital line connection (e.g. SPDIF). |
static Int |
A device type for rerouting audio within the Android framework between mixes and system applications. |
static Int |
A device type describing the transmission of audio signals over the telephony network. |
static Int |
A device type for accessing the audio content transmitted over the TV tuner system. |
static Int |
A device type associated with an unknown or uninitialized device. |
static Int |
A device type describing a USB audio device in accessory mode. |
static Int |
A device type describing a USB audio device. |
static Int |
A device type describing a USB audio headset. |
static Int |
A device type describing a pair of wired headphones. |
static Int |
A device type describing a headset, which is the combination of a headphones and microphone. |
Public methods | |
---|---|
Boolean | |
String | |
MutableList<AudioDescriptor!> | |
MutableList<AudioProfile!> | |
IntArray | |
IntArray | |
IntArray | |
IntArray |
Returns an array of supported encapsulation metadata types for the device. |
IntArray |
Returns an array of supported encapsulation modes for the device. |
IntArray | |
Int |
getId() |
CharSequence! | |
IntArray | |
Int |
getType() |
Int |
hashCode() |
Boolean |
isSink() |
Boolean |
isSource() |
Constants
TYPE_AUX_LINE
static val TYPE_AUX_LINE: Int
A device type describing the auxiliary line-level connectors.
Value: 19
TYPE_BLE_BROADCAST
static val TYPE_BLE_BROADCAST: Int
A device type describing a Bluetooth Low Energy (BLE) broadcast group.
Value: 30
TYPE_BLE_HEADSET
static val TYPE_BLE_HEADSET: Int
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.
Value: 26
TYPE_BLE_SPEAKER
static val TYPE_BLE_SPEAKER: Int
A device type describing a Bluetooth Low Energy (BLE) audio speaker.
Value: 27
TYPE_BLUETOOTH_A2DP
static val TYPE_BLUETOOTH_A2DP: Int
A device type describing a Bluetooth device supporting the A2DP profile.
Value: 8
TYPE_BLUETOOTH_SCO
static val TYPE_BLUETOOTH_SCO: Int
A device type describing a Bluetooth device typically used for telephony.
Value: 7
TYPE_BUILTIN_EARPIECE
static val TYPE_BUILTIN_EARPIECE: Int
A device type describing the attached earphone speaker.
Value: 1
TYPE_BUILTIN_MIC
static val TYPE_BUILTIN_MIC: Int
A device type describing the microphone(s) built in a device.
Value: 15
TYPE_BUILTIN_SPEAKER
static val TYPE_BUILTIN_SPEAKER: Int
A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built in a device.
Value: 2
TYPE_BUILTIN_SPEAKER_SAFE
static val TYPE_BUILTIN_SPEAKER_SAFE: Int
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.
Value: 24
TYPE_BUS
static val TYPE_BUS: Int
A type-agnostic device used for communication with external audio systems
Value: 21
TYPE_DOCK
static val TYPE_DOCK: Int
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
.
Value: 13
See Also
TYPE_DOCK_ANALOG
static val TYPE_DOCK_ANALOG: Int
A device type describing the audio device associated with a dock using an analog connection.
Value: 31
TYPE_FM
static val TYPE_FM: Int
A device type associated with the transmission of audio signals over FM.
Value: 14
TYPE_FM_TUNER
static val TYPE_FM_TUNER: Int
A device type for accessing the audio content transmitted over FM.
Value: 16
TYPE_HDMI
static val TYPE_HDMI: Int
A device type describing an HDMI connection .
Value: 9
TYPE_HDMI_ARC
static val TYPE_HDMI_ARC: Int
A device type describing the Audio Return Channel of an HDMI connection.
Value: 10
TYPE_HDMI_EARC
static val TYPE_HDMI_EARC: Int
A device type describing the Enhanced Audio Return Channel of an HDMI connection.
Value: 29
TYPE_HEARING_AID
static val TYPE_HEARING_AID: Int
A device type describing a Hearing Aid.
Value: 23
TYPE_LINE_ANALOG
static val TYPE_LINE_ANALOG: Int
A device type describing an analog line-level connection.
Value: 5
TYPE_LINE_DIGITAL
static val TYPE_LINE_DIGITAL: Int
A device type describing a digital line connection (e.g. SPDIF).
Value: 6
TYPE_REMOTE_SUBMIX
static val TYPE_REMOTE_SUBMIX: Int
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.
Value: 25
TYPE_TELEPHONY
static val TYPE_TELEPHONY: Int
A device type describing the transmission of audio signals over the telephony network.
Value: 18
TYPE_TV_TUNER
static val TYPE_TV_TUNER: Int
A device type for accessing the audio content transmitted over the TV tuner system.
Value: 17
TYPE_UNKNOWN
static val TYPE_UNKNOWN: Int
A device type associated with an unknown or uninitialized device.
Value: 0
TYPE_USB_ACCESSORY
static val TYPE_USB_ACCESSORY: Int
A device type describing a USB audio device in accessory mode.
Value: 12
TYPE_USB_DEVICE
static val TYPE_USB_DEVICE: Int
A device type describing a USB audio device.
Value: 11
TYPE_USB_HEADSET
static val TYPE_USB_HEADSET: Int
A device type describing a USB audio headset.
Value: 22
TYPE_WIRED_HEADPHONES
static val TYPE_WIRED_HEADPHONES: Int
A device type describing a pair of wired headphones.
Value: 4
TYPE_WIRED_HEADSET
static val TYPE_WIRED_HEADSET: Int
A device type describing a headset, which is the combination of a headphones and microphone.
Value: 3
Public methods
equals
fun equals(other: Any?): Boolean
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getAddress
fun getAddress(): String
Return | |
---|---|
String |
The "address" string of the device. This generally contains device-specific parameters. This value cannot be null . |
getAudioDescriptors
fun getAudioDescriptors(): MutableList<AudioDescriptor!>
Return | |
---|---|
MutableList<AudioDescriptor!> |
A list of AudioDescriptor supported by the audio devices. This value cannot be null . |
getAudioProfiles
fun getAudioProfiles(): MutableList<AudioProfile!>
Return | |
---|---|
MutableList<AudioProfile!> |
A list of AudioProfile supported by the audio devices. This value cannot be null . |
getChannelCounts
fun getChannelCounts(): IntArray
Return | |
---|---|
IntArray |
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
fun getChannelIndexMasks(): IntArray
Return | |
---|---|
IntArray |
An array of channel index masks for which this audio device can be configured. This value cannot be null . |
See Also
getChannelMasks
fun getChannelMasks(): IntArray
Return | |
---|---|
IntArray |
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 be null . |
See Also
getEncapsulationMetadataTypes
fun getEncapsulationMetadataTypes(): IntArray
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
.
Return | |
---|---|
IntArray |
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, android.media.AudioTrack#ENCAPSULATION_METADATA_TYPE_FRAMEWORK_TUNER , android.media.AudioTrack#ENCAPSULATION_METADATA_TYPE_DVB_AD_DESCRIPTOR , or android.media.AudioTrack#ENCAPSULATION_METADATA_TYPE_SUPPLEMENTARY_AUDIO_PLACEMENT |
getEncapsulationModes
fun getEncapsulationModes(): IntArray
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
.
Return | |
---|---|
IntArray |
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 is android.media.AudioTrack#ENCAPSULATION_MODE_NONE , or android.media.AudioTrack#ENCAPSULATION_MODE_ELEMENTARY_STREAM |
getEncodings
fun getEncodings(): IntArray
Return | |
---|---|
IntArray |
An array of audio encodings (e.g. AudioFormat#ENCODING_PCM_16BIT , AudioFormat#ENCODING_PCM_FLOAT ) supported by the audio device. ENCODING_PCM_FLOAT indicates the device supports more than 16 bits of integer precision. As there is no AudioFormat constant specifically defined for 24-bit PCM, the value ENCODING_PCM_FLOAT indicates that AudioTrack or AudioRecord can preserve at least 24 bits of integer precision to that device. This value cannot be null . |
See Also
getProductName
fun getProductName(): CharSequence!
Return | |
---|---|
CharSequence! |
The human-readable name of the audio device. |
getSampleRates
fun getSampleRates(): IntArray
Return | |
---|---|
IntArray |
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 . |
getType
fun getType(): Int
isSink
fun isSink(): Boolean
Return | |
---|---|
Boolean |
true if the audio device is a sink for audio data (i.e. an output). |
isSource
fun isSource(): Boolean
Return | |
---|---|
Boolean |
true if the audio device is a source for audio data (e.e an input). |