FileDocCategorySizeDatePackage
AudioDevice.javaAPI DocAndroid 5.1 API10461Thu Mar 12 22:22:30 GMT 2015android.media

AudioDevice

public class AudioDevice extends Object
Class to provide information about the audio devices.
hide

Fields Summary
public static final int
TYPE_UNKNOWN
A device type associated with an unknown or uninitialized device.
public static final int
TYPE_BUILTIN_EARPIECE
A device type describing the attached earphone 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.
public static final int
TYPE_WIRED_HEADSET
A device type describing a headset, which is the combination of a headphones and microphone.
public static final int
TYPE_WIRED_HEADPHONES
A device type describing a pair of wired headphones .
public static final int
TYPE_LINE_ANALOG
A device type describing an analog line-level connection.
public static final int
TYPE_LINE_DIGITAL
A device type describing a digital line connection (e.g. SPDIF).
public static final int
TYPE_BLUETOOTH_SCO
A device type describing a Bluetooth device typically used for telephony .
public static final int
TYPE_BLUETOOTH_A2DP
A device type describing a Bluetooth device supporting the A2DP profile.
public static final int
TYPE_HDMI
A device type describing an HDMI connection .
public static final int
TYPE_HDMI_ARC
A device type describing the Audio Return Channel of an HDMI connection.
public static final int
TYPE_USB_DEVICE
A device type describing a USB audio device.
public static final int
TYPE_USB_ACCESSORY
A device type describing a USB audio device in accessory mode.
public static final int
TYPE_DOCK
A device type describing the audio device associated with a dock.
public static final int
TYPE_FM
A device type associated with the transmission of audio signals over FM.
public static final int
TYPE_BUILTIN_MIC
A device type describing the microphone(s) built in a device.
public static final int
TYPE_FM_TUNER
A device type for accessing the audio content transmitted over FM.
public static final int
TYPE_TV_TUNER
A device type for accessing the audio content transmitted over the TV tuner system.
public static final int
TYPE_TELEPHONY
A device type describing the transmission of audio signals over the telephony network.
public static final int
TYPE_AUX_LINE
A device type describing the auxiliary line-level connectors.
AudioDevicePortConfig
mConfig
private static final android.util.SparseIntArray
INT_TO_EXT_DEVICE_MAPPING
private static final android.util.SparseIntArray
EXT_TO_INT_DEVICE_MAPPING
Constructors Summary
AudioDevice(AudioDevicePortConfig config)


      
        mConfig = new AudioDevicePortConfig(config);
    
Methods Summary
public static intconvertDeviceTypeToInternalDevice(int deviceType)

hide

        return EXT_TO_INT_DEVICE_MAPPING.get(deviceType, AudioSystem.DEVICE_NONE);
    
public static intconvertInternalDeviceToDeviceType(int intDevice)

hide

        return INT_TO_EXT_DEVICE_MAPPING.get(intDevice, TYPE_UNKNOWN);
    
public java.lang.StringgetAddress()

hide
CANDIDATE FOR PUBLIC API
return

        return mConfig.port().address();
    
public intgetDeviceType()

hide
CANDIDATE FOR PUBLIC API
return

        return INT_TO_EXT_DEVICE_MAPPING.get(mConfig.port().type(), TYPE_UNKNOWN);
    
public booleanisInputDevice()

hide
CANDIDATE FOR PUBLIC API
return

        return (mConfig.port().role() == AudioPort.ROLE_SOURCE);
    
public booleanisOutputDevice()

hide
CANDIDATE FOR PUBLIC API
return

        return (mConfig.port().role() == AudioPort.ROLE_SINK);