Most visited

Recently visited

Added in API level 23

AudioDeviceInfo

public final class AudioDeviceInfo
extends Object

java.lang.Object
   ↳ android.media.AudioDeviceInfo


提供有关音频设备信息的类。

Summary

Constants

int TYPE_AUX_LINE

描述辅助线路级连接器的设备类型。

int TYPE_BLUETOOTH_A2DP

描述支持A2DP配置文件的蓝牙设备的设备类型。

int TYPE_BLUETOOTH_SCO

描述通常用于电话的蓝牙设备的设备类型。

int TYPE_BUILTIN_EARPIECE

描述连接的耳机扬声器的设备类型。

int TYPE_BUILTIN_MIC

描述设备内置的麦克风的设备类型。

int TYPE_BUILTIN_SPEAKER

描述扬声器系统的设备类型(即,

int TYPE_BUS

用于与外部音频系统通信的类型不可知设备

int TYPE_DOCK

描述与码头关联的音频设备的设备类型。

int TYPE_FM

与通过FM传输音频信号相关的设备类型。

int TYPE_FM_TUNER

用于访问通过FM传输的音频内容的设备类型。

int TYPE_HDMI

描述HDMI连接的设备类型。

int TYPE_HDMI_ARC

描述HDMI连接的音频返回通道的设备类型。

int TYPE_IP

通过IP连接的设备类型。

int TYPE_LINE_ANALOG

描述模拟线路级连接的设备类型。

int TYPE_LINE_DIGITAL

描述数字线路连接的设备类型(例如,

int TYPE_TELEPHONY

描述通过电话网络传输音频信号的设备类型。

int TYPE_TV_TUNER

用于访问通过电视调谐器系统传输的音频内容的设备类型。

int TYPE_UNKNOWN

与未知或未初始化设备关联的设备类型。

int TYPE_USB_ACCESSORY

描述配件模式下的USB音频设备的设备类型。

int TYPE_USB_DEVICE

描述USB音频设备的设备类型。

int TYPE_WIRED_HEADPHONES

描述一对有线耳机的设备类型。

int TYPE_WIRED_HEADSET

描述耳机的设备类型,它是耳机和麦克风的组合。

Public methods

int[] getChannelCounts()
int[] getChannelIndexMasks()
int[] getChannelMasks()
int[] getEncodings()
int getId()
CharSequence getProductName()
int[] getSampleRates()
int getType()
boolean isSink()
boolean isSource()

Inherited methods

From class java.lang.Object

Constants

TYPE_AUX_LINE

Added in API level 23
int TYPE_AUX_LINE

描述辅助线路级连接器的设备类型。

常量值:19(0x00000013)

TYPE_BLUETOOTH_A2DP

Added in API level 23
int TYPE_BLUETOOTH_A2DP

描述支持A2DP配置文件的蓝牙设备的设备类型。

常量值:8(0x00000008)

TYPE_BLUETOOTH_SCO

Added in API level 23
int TYPE_BLUETOOTH_SCO

描述通常用于电话的蓝牙设备的设备类型。

常量值:7(0x00000007)

TYPE_BUILTIN_EARPIECE

Added in API level 23
int TYPE_BUILTIN_EARPIECE

描述连接的耳机扬声器的设备类型。

常数值:1(0x00000001)

TYPE_BUILTIN_MIC

Added in API level 23
int TYPE_BUILTIN_MIC

描述设备内置的麦克风的设备类型。

常量值:15(0x0000000f)

TYPE_BUILTIN_SPEAKER

Added in API level 23
int TYPE_BUILTIN_SPEAKER

描述设备内置扬声器系统(即单声道扬声器或立体声扬声器)的设备类型。

常量值:2(0x00000002)

TYPE_BUS

Added in API level 24
int TYPE_BUS

用于与外部音频系统通信的类型不可知设备

常量值:21(0x00000015)

TYPE_DOCK

Added in API level 23
int TYPE_DOCK

描述与码头关联的音频设备的设备类型。

常量值:13(0x0000000d)

TYPE_FM

Added in API level 23
int TYPE_FM

与通过FM传输音频信号相关的设备类型。

常量值:14(0x0000000e)

TYPE_FM_TUNER

Added in API level 23
int TYPE_FM_TUNER

用于访问通过FM传输的音频内容的设备类型。

常量值:16(0x00000010)

TYPE_HDMI

Added in API level 23
int TYPE_HDMI

描述HDMI连接的设备类型。

常量值:9(0x00000009)

TYPE_HDMI_ARC

Added in API level 23
int TYPE_HDMI_ARC

描述HDMI连接的音频返回通道的设备类型。

常量值:10(0x0000000a)

TYPE_IP

Added in API level 23
int TYPE_IP

通过IP连接的设备类型。

常量值:20(0x00000014)

TYPE_LINE_ANALOG

Added in API level 23
int TYPE_LINE_ANALOG

描述模拟线路级连接的设备类型。

常量值:5(0x00000005)

TYPE_LINE_DIGITAL

Added in API level 23
int TYPE_LINE_DIGITAL

描述数字线路连接(例如SPDIF)的设备类型。

常数值:6(0x00000006)

TYPE_TELEPHONY

Added in API level 23
int TYPE_TELEPHONY

描述通过电话网络传输音频信号的设备类型。

常量值:18(0x00000012)

TYPE_TV_TUNER

Added in API level 23
int TYPE_TV_TUNER

用于访问通过电视调谐器系统传输的音频内容的设备类型。

常量值:17(0x00000011)

TYPE_UNKNOWN

Added in API level 23
int TYPE_UNKNOWN

与未知或未初始化设备关联的设备类型。

常量值:0(0x00000000)

TYPE_USB_ACCESSORY

Added in API level 23
int TYPE_USB_ACCESSORY

描述配件模式下的USB音频设备的设备类型。

常量值:12(0x0000000c)

TYPE_USB_DEVICE

Added in API level 23
int TYPE_USB_DEVICE

描述USB音频设备的设备类型。

常量值:11(0x0000000b)

TYPE_WIRED_HEADPHONES

Added in API level 23
int TYPE_WIRED_HEADPHONES

描述一对有线耳机的设备类型。

常量值:4(0x00000004)

TYPE_WIRED_HEADSET

Added in API level 23
int TYPE_WIRED_HEADSET

描述耳机的设备类型,它是耳机和麦克风的组合。

常量值:3(0x00000003)

Public methods

getChannelCounts

Added in API level 23
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.

getChannelIndexMasks

Added in API level 23
int[] getChannelIndexMasks ()

Returns
int[] An array of channel index masks for which this audio device can be configured.

也可以看看:

getChannelMasks

Added in API level 23
int[] getChannelMasks ()

Returns
int[] An array of channel position masks (e.g. CHANNEL_IN_STEREO, CHANNEL_OUT_7POINT1) for which this audio device can be configured.

See also:

getEncodings

Added in API level 23
int[] getEncodings ()

Returns
int[] An array of audio encodings (e.g. ENCODING_PCM_16BIT, 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.

也可以看看:

getId

Added in API level 23
int getId ()

Returns
int The internal device ID.

getProductName

Added in API level 23
CharSequence getProductName ()

Returns
CharSequence The human-readable name of the audio device.

getSampleRates

Added in API level 23
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.

getType

Added in API level 23
int getType ()

Returns
int The device type identifier of the audio device (i.e. TYPE_BUILTIN_SPEAKER).

isSink

Added in API level 23
boolean isSink ()

Returns
boolean true if the audio device is a sink for audio data (i.e. an output).

isSource

Added in API level 23
boolean isSource ()

Returns
boolean true if the audio device is a source for audio data (e.e an input).

Hooray!