harmony 鸿蒙native_audio_device_base.h
native_audio_device_base.h
Overview
The native_audio_device_base.h file declares the types of audio device parameters and the functions for obtaining these parameters.
Library: libohaudio.so
File to include: <ohaudio/native_audio_device_base.h>
System capability: SystemCapability.Multimedia.Audio.Core
Since: 12
Related module: OHAudio
Summary
Structs
Name | Description |
---|---|
struct OH_AudioDeviceDescriptorArray | Describes an array of audio device descriptors. |
Types
Name | Description |
---|---|
typedef struct OH_AudioDeviceDescriptor OH_AudioDeviceDescriptor | Defines a struct for an audio device descriptor. It provides detailed attributes of an audio device. |
typedef struct OH_AudioDeviceDescriptorArray OH_AudioDeviceDescriptorArray | Defines a struct for an array of audio device descriptors. |
Enums
Name | Description |
---|---|
OH_AudioDevice_ChangeType { AUDIO_DEVICE_CHANGE_TYPE_CONNECT = 0, AUDIO_DEVICE_CHANGE_TYPE_DISCONNECT = 1 } |
Enumerates the types of audio device changes. |
OH_AudioDevice_Role { AUDIO_DEVICE_ROLE_INPUT = 1, AUDIO_DEVICE_ROLE_OUTPUT = 2 } |
Enumerates the roles of audio devices. |
OH_AudioDevice_Type { AUDIO_DEVICE_TYPE_INVALID = 0, AUDIO_DEVICE_TYPE_EARPIECE = 1, AUDIO_DEVICE_TYPE_SPEAKER = 2, AUDIO_DEVICE_TYPE_WIRED_HEADSET = 3, AUDIO_DEVICE_TYPE_WIRED_HEADPHONES = 4, AUDIO_DEVICE_TYPE_BLUETOOTH_SCO = 7, AUDIO_DEVICE_TYPE_BLUETOOTH_A2DP = 8, AUDIO_DEVICE_TYPE_MIC = 15, AUDIO_DEVICE_TYPE_USB_HEADSET = 22, AUDIO_DEVICE_TYPE_DISPLAY_PORT = 23, AUDIO_DEVICE_TYPE_REMOTE_CAST = 24, AUDIO_DEVICE_TYPE_HDMI = 27, AUDIO_DEVICE_TYPE_LINE_DIGITAL = 28, AUDIO_DEVICE_TYPE_DEFAULT = 1000 } |
Enumerates the types of audio devices. |
OH_AudioDevice_Flag { AUDIO_DEVICE_FLAG_NONE = 0, AUDIO_DEVICE_FLAG_OUTPUT = 1, AUDIO_DEVICE_FLAG_INPUT = 2, AUDIO_DEVICE_FLAG_ALL = 3 } |
Enumerates the flags of audio devices. |
OH_AudioDevice_Usage { AUDIO_DEVICE_USAGE_MEDIA_OUTPUT = 1, AUDIO_DEVICE_USAGE_MEDIA_INPUT = 2, AUDIO_DEVICE_USAGE_MEDIA_ALL = 3, AUDIO_DEVICE_USAGE_CALL_OUTPUT = 4, AUDIO_DEVICE_USAGE_CALL_INPUT = 8, AUDIO_DEVICE_USAGE_CALL_ALL = 12 } |
Enumerates the usage scenarios of audio devices. |
OH_AudioDevice_BlockStatus { AUDIO_DEVICE_UNBLOCKED = 0, AUDIO_DEVICE_BLOCKED = 1 } |
Enumerates the blocked status of audio devices. By default, an audio device is not blocked. |
Functions
Name | Description |
---|---|
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceRole(OH_AudioDeviceDescriptor *audioDeviceDescriptor, OH_AudioDevice_Role *deviceRole) | Obtains the device role based on an audio device descriptor. |
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceType(OH_AudioDeviceDescriptor *audioDeviceDescriptor, OH_AudioDevice_Type *deviceType) | Obtains the device type based on an audio device descriptor. |
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceId(OH_AudioDeviceDescriptor *audioDeviceDescriptor, uint32_t *id) | Obtains the device ID based on an audio device descriptor. |
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceName(OH_AudioDeviceDescriptor *audioDeviceDescriptor, char **name) | Obtains the device name based on an audio device descriptor. |
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceAddress(OH_AudioDeviceDescriptor *audioDeviceDescriptor, char **address) | Obtains the device address based on an audio device descriptor. |
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceSampleRates(OH_AudioDeviceDescriptor *audioDeviceDescriptor, uint32_t **sampleRates, uint32_t *size) | Obtains the sample rates based on an audio device descriptor. |
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceChannelCounts(OH_AudioDeviceDescriptor *audioDeviceDescriptor, uint32_t **channelCounts, uint32_t *size) | Obtains an array that holds the number of device channels based on an audio device descriptor. |
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceDisplayName(OH_AudioDeviceDescriptor *audioDeviceDescriptor, char **displayName) | Obtains the device display name based on an audio device descriptor. |
OH_AudioCommon_Result OH_AudioDeviceDescriptor_GetDeviceEncodingTypes(OH_AudioDeviceDescriptor *audioDeviceDescriptor, OH_AudioStream_EncodingType **encodingTypes, uint32_t *size) | Obtains the device encoding types based on an audio device descriptor. |
你可能感兴趣的鸿蒙文章
harmony 鸿蒙OH_AudioCapturer_Callbacks_Struct
harmony 鸿蒙OH_AudioDeviceDescriptorArray
harmony 鸿蒙OH_AudioRenderer_Callbacks_Struct
harmony 鸿蒙OH_AudioSession_DeactivatedEvent
harmony 鸿蒙OH_AudioSession_Strategy
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦