1e41f4b71Sopenharmony_ci# HdiAudio (V2_0) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## 概述 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciAudio模块接口定义。 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci音频接口涉及数据类型、驱动加载接口、驱动适配器接口、音频播放接口、音频录音接口等。 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**起始版本:** 4.1 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## 汇总 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci### 文件 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci| 名称 | 描述 | 19e41f4b71Sopenharmony_ci| -------- | -------- | 20e41f4b71Sopenharmony_ci| [AudioTypes.idl](_audio_types_8idl_v20.md) | Audio模块接口定义中使用的数据类型。 | 21e41f4b71Sopenharmony_ci| [IAudioAdapter.idl](_i_audio_adapter_8idl_v20.md) | Audio适配器的接口定义文件。 | 22e41f4b71Sopenharmony_ci| [IAudioCallback.idl](_i_audio_callback_8idl_v20.md) | Audio播放的回调函数定义文件。 | 23e41f4b71Sopenharmony_ci| [IAudioCapture.idl](_i_audio_capture_8idl_v20.md) | Audio录音的接口定义文件。 | 24e41f4b71Sopenharmony_ci| [IAudioManager.idl](_i_audio_manager_8idl_v20.md) | Audio适配器管理及加载的接口定义文件。 | 25e41f4b71Sopenharmony_ci| [IAudioRender.idl](_i_audio_render_8idl_v20.md) | Audio播放的接口定义文件。 | 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci### 类 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci| 名称 | 描述 | 31e41f4b71Sopenharmony_ci| -------- | -------- | 32e41f4b71Sopenharmony_ci| struct [AudioDeviceStatus](_audio_device_status_v20.md) | 音频设备状态。 | 33e41f4b71Sopenharmony_ci| union [SceneDesc](union_scene_desc_v20.md) | 音频场景描述。 | 34e41f4b71Sopenharmony_ci| struct [AudioPort](_audio_port_v20.md) | 音频端口。 | 35e41f4b71Sopenharmony_ci| struct [AudioAdapterDescriptor](_audio_adapter_descriptor_v20.md) | 音频适配器描述符。 | 36e41f4b71Sopenharmony_ci| struct [AudioDeviceDescriptor](_audio_device_descriptor_v20.md) | 音频设备描述符。 | 37e41f4b71Sopenharmony_ci| struct [AudioSceneDescriptor](_audio_scene_descriptor_v20.md) | 音频场景描述符。 | 38e41f4b71Sopenharmony_ci| struct [AudioOffloadInfo](_audio_offload_info_v20.md) | 音频低功耗属性 | 39e41f4b71Sopenharmony_ci| struct [AudioSampleAttributes](_audio_sample_attributes_v20.md) | 音频采样属性。 | 40e41f4b71Sopenharmony_ci| struct [AudioTimeStamp](_audio_time_stamp_v20.md) | 音频时间戳。 | 41e41f4b71Sopenharmony_ci| struct [AudioSubPortCapability](_audio_sub_port_capability_v20.md) | 音频子端口的支持能力。 | 42e41f4b71Sopenharmony_ci| struct [AudioPortCapability](_audio_port_capability_v20.md) | 音频端口的支持能力。 | 43e41f4b71Sopenharmony_ci| struct [AudioMmapBufferDescripter](_audio_mmap_buffer_descripter_v20.md) | mmap缓冲区描述符。 | 44e41f4b71Sopenharmony_ci| struct [AudioDevExtInfo](_audio_dev_ext_info_v20.md) | 音频设备拓展信息。 | 45e41f4b71Sopenharmony_ci| struct [AudioMixExtInfo](_audio_mix_ext_info_v20.md) | 音轨拓展信息。 | 46e41f4b71Sopenharmony_ci| struct [AudioSessionExtInfo](_audio_session_ext_info_v20.md) | 会话拓展信息。 | 47e41f4b71Sopenharmony_ci| struct [AudioInfo](_audio_info_v20.md) | 音频端口特定信息。 | 48e41f4b71Sopenharmony_ci| struct [AudioRouteNode](_audio_route_node_v20.md) | 音频路由节点。 | 49e41f4b71Sopenharmony_ci| struct [AudioRoute](_audio_route_v20.md) | 音频路由信息。 | 50e41f4b71Sopenharmony_ci| struct [AudioEvent](_audio_event_v20.md) | 音频事件。 | 51e41f4b71Sopenharmony_ci| interface [IAudioAdapter](interface_i_audio_adapter_v20.md) | AudioAdapter音频适配器接口。 | 52e41f4b71Sopenharmony_ci| interface [IAudioCallback](interface_i_audio_callback_v20.md) | Audio回调接口。 | 53e41f4b71Sopenharmony_ci| interface [IAudioCapture](interface_i_audio_capture_v20.md) | 音频接口的包路径。 | 54e41f4b71Sopenharmony_ci| interface [IAudioManager](interface_i_audio_manager_v20.md) | AudioManager音频适配器管理接口。 | 55e41f4b71Sopenharmony_ci| interface [IAudioRender](interface_i_audio_render_v20.md) | AudioRender音频播放接口。 | 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci### 枚举 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci| 名称 | 描述 | 61e41f4b71Sopenharmony_ci| -------- | -------- | 62e41f4b71Sopenharmony_ci| [AudioPortDirection](#audioportdirection) { PORT_OUT = 1 , PORT_IN = 2 , PORT_OUT_IN = 3 } | 音频端口的类型。 | 63e41f4b71Sopenharmony_ci| [AudioPortPin](#audioportpin) {<br/>PIN_NONE = 0 , PIN_OUT_SPEAKER = 1 << 0 , PIN_OUT_HEADSET = 1 << 1 , PIN_OUT_LINEOUT = 1 << 2 ,<br/>PIN_OUT_HDMI = 1 << 3 , PIN_OUT_USB = 1 << 4 , PIN_OUT_USB_EXT = 1 << 5 , PIN_OUT_EARPIECE = 1 << 5 \| 1 << 4 ,<br/>PIN_OUT_BLUETOOTH_SCO = 1 << 6 , PIN_OUT_DAUDIO_DEFAULT = 1 << 7 , PIN_OUT_HEADPHONE = 1 << 8 , PIN_OUT_USB_HEADSET = 1 << 9 ,<br/>PIN_OUT_BLUETOOTH_A2DP = 1 << 10 , PIN_IN_MIC = 1 << 27 \| 1 << 0 , PIN_IN_HS_MIC = 1 << 27 \| 1 << 1 , PIN_IN_LINEIN = 1 << 27 \| 1 << 2 ,<br/>PIN_IN_USB_EXT = 1 << 27 \| 1 << 3 , PIN_IN_BLUETOOTH_SCO_HEADSET = 1 << 27 \| 1 << 4 , PIN_IN_DAUDIO_DEFAULT = 1 << 27 \| 1 << 5 , PIN_IN_USB_HEADSET = 1 << 27 \| 1 << 6<br/>} | 音频端口上的Pin脚。 | 64e41f4b71Sopenharmony_ci| [AudioCategory](#audiocategory) {<br/>AUDIO_IN_MEDIA = 0 , AUDIO_IN_COMMUNICATION = 1 , AUDIO_IN_RINGTONE = 2 , AUDIO_IN_CALL = 3 ,<br/>AUDIO_MMAP_NOIRQ = 4 , AUDIO_OFFLOAD = 5 , AUDIO_MULTI_CHANNEL = 6<br/>} | 音频类型(场景)。 | 65e41f4b71Sopenharmony_ci| [AudioFormat](#audioformat) {<br/>AUDIO_FORMAT_TYPE_PCM_8_BIT = 1 << 0 , AUDIO_FORMAT_TYPE_PCM_16_BIT = 1 << 1 , AUDIO_FORMAT_TYPE_PCM_24_BIT = 1 << 1 \| 1 << 0 , AUDIO_FORMAT_TYPE_PCM_32_BIT = 1 << 2 ,<br/>AUDIO_FORMAT_TYPE_PCM_FLOAT = 1 << 2 \| 1 << 0 , AUDIO_FORMAT_TYPE_MP3 = 1 << 24 , AUDIO_FORMAT_TYPE_AAC_MAIN = 1 << 24 \| 1 << 0 , AUDIO_FORMAT_TYPE_AAC_LC = 1 << 24 \| 1 << 1 ,<br/>AUDIO_FORMAT_TYPE_AAC_LD = 1 << 24 \| 1 << 1 \| 1 << 0 , AUDIO_FORMAT_TYPE_AAC_ELD = 1 << 24 \| 1 << 2 , AUDIO_FORMAT_TYPE_AAC_HE_V1 = 1 << 24 \| 1 << 2 \| 1 << 0 , AUDIO_FORMAT_TYPE_AAC_HE_V2 = 1 << 24 \| 1 << 2 \| 1 << 1 ,<br/>AUDIO_FORMAT_TYPE_G711A = 1 << 25 \| 1 << 0 , AUDIO_FORMAT_TYPE_G711U = 1 << 25 \| 1 << 1 , AUDIO_FORMAT_TYPE_G726 = 1 << 25 \| 1 << 1 \| 1 << 0<br/>} | 音频格式。 | 66e41f4b71Sopenharmony_ci| [AudioChannelMask](#audiochannelmask) { AUDIO_CHANNEL_FRONT_LEFT = 1 , AUDIO_CHANNEL_FRONT_RIGHT = 2 , AUDIO_CHANNEL_MONO = 1 , AUDIO_CHANNEL_STEREO = 3 } | 音频通道掩码。 | 67e41f4b71Sopenharmony_ci| [AudioSampleRatesMask](#audiosampleratesmask) {<br/>AUDIO_SAMPLE_RATE_MASK_8000 = 1 << 0 , AUDIO_SAMPLE_RATE_MASK_12000 = 1 << 1 , AUDIO_SAMPLE_RATE_MASK_11025 = 1 << 2 , AUDIO_SAMPLE_RATE_MASK_16000 = 1 << 3 ,<br/>AUDIO_SAMPLE_RATE_MASK_22050 = 1 << 4 , AUDIO_SAMPLE_RATE_MASK_24000 = 1 << 5 , AUDIO_SAMPLE_RATE_MASK_32000 = 1 << 6 , AUDIO_SAMPLE_RATE_MASK_44100 = 1 << 7 ,<br/>AUDIO_SAMPLE_RATE_MASK_48000 = 1 << 8 , AUDIO_SAMPLE_RATE_MASK_64000 = 1 << 9 , AUDIO_SAMPLE_RATE_MASK_96000 = 1 << 10 , AUDIO_SAMPLE_RATE_MASK_INVALID = 4294967295<br/>} | 音频采样频率掩码。 | 68e41f4b71Sopenharmony_ci| [AudioPortPassthroughMode](#audioportpassthroughmode) { PORT_PASSTHROUGH_LPCM = 1 << 0 , PORT_PASSTHROUGH_RAW = 1 << 1 , PORT_PASSTHROUGH_HBR2LBR = 1 << 2 , PORT_PASSTHROUGH_AUTO = 1 << 3 } | 音频端口的数据透传模式。 | 69e41f4b71Sopenharmony_ci| [AudioSampleFormat](#audiosampleformat) {<br/>AUDIO_SAMPLE_FORMAT_S8 = 0 , AUDIO_SAMPLE_FORMAT_S8P = 1 , AUDIO_SAMPLE_FORMAT_U8 = 2 , AUDIO_SAMPLE_FORMAT_U8P = 3 ,<br/>AUDIO_SAMPLE_FORMAT_S16 = 4 , AUDIO_SAMPLE_FORMAT_S16P = 5 , AUDIO_SAMPLE_FORMAT_U16 = 6 , AUDIO_SAMPLE_FORMAT_U16P = 7 ,<br/>AUDIO_SAMPLE_FORMAT_S24 = 8 , AUDIO_SAMPLE_FORMAT_S24P = 9 , AUDIO_SAMPLE_FORMAT_U24 = 10 , AUDIO_SAMPLE_FORMAT_U24P = 11 ,<br/>AUDIO_SAMPLE_FORMAT_S32 = 12 , AUDIO_SAMPLE_FORMAT_S32P = 13 , AUDIO_SAMPLE_FORMAT_U32 = 14 , AUDIO_SAMPLE_FORMAT_U32P = 15 ,<br/>AUDIO_SAMPLE_FORMAT_S64 = 16 , AUDIO_SAMPLE_FORMAT_S64P = 17 , AUDIO_SAMPLE_FORMAT_U64 = 18 , AUDIO_SAMPLE_FORMAT_U64P = 19 ,<br/>AUDIO_SAMPLE_FORMAT_F32 = 20 , AUDIO_SAMPLE_FORMAT_F32P = 21 , AUDIO_SAMPLE_FORMAT_F64 = 22 , AUDIO_SAMPLE_FORMAT_F64P = 23<br/>} | 原始音频样本格式。 | 70e41f4b71Sopenharmony_ci| [AudioChannelMode](#audiochannelmode) {<br/>AUDIO_CHANNEL_NORMAL = 0 , AUDIO_CHANNEL_BOTH_LEFT = 1 , AUDIO_CHANNEL_BOTH_RIGHT = 2 , AUDIO_CHANNEL_EXCHANGE = 3 , AUDIO_CHANNEL_MIX = 4 , AUDIO_CHANNEL_LEFT_MUTE = 5 , AUDIO_CHANNEL_RIGHT_MUTE = 6 , AUDIO_CHANNEL_BOTH_MUTE = 7<br/>} | 音频播放的通道模式。 | 71e41f4b71Sopenharmony_ci| [AudioDrainNotifyType](#audiodrainnotifytype) { AUDIO_DRAIN_NORMAL_MODE = 0 , AUDIO_DRAIN_EARLY_MODE = 1 } | 音频数据结束类型。 | 72e41f4b71Sopenharmony_ci| [AudioCallbackType](#audiocallbacktype) {<br/>AUDIO_NONBLOCK_WRITE_COMPELETED = 0 , AUDIO_DRAIN_COMPELETED = 1 , AUDIO_FLUSH_COMPLETED = 2 , AUDIO_RENDER_FULL = 3 ,<br/>AUDIO_ERROR_OCCUR = 4<br/>} | 回调函数通知事件类型。 | 73e41f4b71Sopenharmony_ci| [AudioPortRole](#audioportrole) { AUDIO_PORT_UNASSIGNED_ROLE = 0 , AUDIO_PORT_SOURCE_ROLE = 1 , AUDIO_PORT_SINK_ROLE = 2 } | 音频端口角色。 | 74e41f4b71Sopenharmony_ci| [AudioPortType](#audioporttype) { AUDIO_PORT_UNASSIGNED_TYPE = 0 , AUDIO_PORT_DEVICE_TYPE = 1 , AUDIO_PORT_MIX_TYPE = 2 , AUDIO_PORT_SESSION_TYPE = 3 } | 音频端口类型。 | 75e41f4b71Sopenharmony_ci| [AudioSessionType](#audiosessiontype) { AUDIO_OUTPUT_STAGE_SESSION = 0 , AUDIO_OUTPUT_MIX_SESSION = 1 , AUDIO_ALLOCATE_SESSION = 2 , AUDIO_INVALID_SESSION = 3 } | 端口会话类型。 | 76e41f4b71Sopenharmony_ci| [AudioDeviceType](#audiodevicetype) {<br/>AUDIO_LINEOUT = 1 << 0 , AUDIO_HEADPHONE = 1 << 1 , AUDIO_HEADSET = 1 << 2 , AUDIO_USB_HEADSET = 1 << 3 ,<br/>AUDIO_USB_HEADPHONE = 1 << 4 , AUDIO_USBA_HEADSET = 1 << 5 , AUDIO_USBA_HEADPHONE = 1 << 6 , AUDIO_PRIMARY_DEVICE = 1 << 7 , AUDIO_USB_DEVICE = 1 << 8 , AUDIO_A2DP_DEVICE = 1 << 9 , AUDIO_HDMI_DEVICE = 1 << 10 , AUDIO_ADAPTER_DEVICE = 1 << 11 , AUDIO_DEVICE_UNKOWN<br/>} | 音频设备类型。 | 77e41f4b71Sopenharmony_ci| [AudioEventType](#audioeventtype) {<br/>AUDIO_DEVICE_ADD = 1 , AUDIO_DEVICE_REMOVE = 2 , AUDIO_LOAD_SUCCESS = 3 , AUDIO_LOAD_FAILURE = 4 ,<br/>AUDIO_UNLOAD = 5 , AUDIO_SERVICE_VALID = 7 , AUDIO_SERVICE_INVALID = 8 , AUDIO_CAPTURE_THRESHOLD = 9 , AUDIO_EVENT_UNKOWN = 10<br/>} | 音频事件类型。 | 78e41f4b71Sopenharmony_ci| [AudioExtParamKey](#audioextparamkey) {<br/>AUDIO_EXT_PARAM_KEY_NONE = 0 , AUDIO_EXT_PARAM_KEY_VOLUME = 1 , AUDIO_EXT_PARAM_KEY_FOCUS = 2 , AUDIO_EXT_PARAM_KEY_BUTTON = 3 ,<br/>AUDIO_EXT_PARAM_KEY_EFFECT = 4 , AUDIO_EXT_PARAM_KEY_STATUS = 5 , AUDIO_EXT_PARAM_KEY_USB_DEVICE = 101 , AUDIO_EXT_PARAM_KEY_PERF_INFO = 201 ,<br/>AUDIO_EXT_PARAM_KEY_MMI = 301 , AUDIO_EXT_PARAM_KEY_LOWPOWER = 1000<br/>} | 音频扩展参数键类型。 | 79e41f4b71Sopenharmony_ci| [AudioInputType](#audioinputtype) {<br/>AUDIO_INPUT_DEFAULT_TYPE = 0 , AUDIO_INPUT_MIC_TYPE = 1 << 0 , AUDIO_INPUT_SPEECH_WAKEUP_TYPE = 1 << 1 , AUDIO_INPUT_VOICE_COMMUNICATION_TYPE = 1 << 2 ,<br/>AUDIO_INPUT_VOICE_RECOGNITION_TYPE = 1 << 3 , AUDIO_INPUT_VOICE_UPLINK_TYPE = 1 << 4 , AUDIO_INPUT_VOICE_DOWNLINK_TYPE = 1 << 5 , AUDIO_INPUT_VOICE_CALL_TYPE = 1 << 6 ,<br/>AUDIO_INPUT_CAMCORDER_TYPE = 1 << 7<br/>} | 音频输入类型. | 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci## 枚举类型说明 83e41f4b71Sopenharmony_ci 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci### AudioCallbackType 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci``` 88e41f4b71Sopenharmony_cienum AudioCallbackType 89e41f4b71Sopenharmony_ci``` 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci**描述** 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci回调函数通知事件类型。 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci**起始版本:** 4.1 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 98e41f4b71Sopenharmony_ci| -------- | -------- | 99e41f4b71Sopenharmony_ci| AUDIO_NONBLOCK_WRITE_COMPELETED | 非阻塞式写完成。 | 100e41f4b71Sopenharmony_ci| AUDIO_DRAIN_COMPELETED | DrainBuffer完成,详情参考[DrainBuffer](interface_i_audio_render_v20.md#drainbuffer)。 | 101e41f4b71Sopenharmony_ci| AUDIO_FLUSH_COMPLETED | Flush完成,详情参考[Flush](interface_i_audio_render_v20.md#flush)。 | 102e41f4b71Sopenharmony_ci| AUDIO_RENDER_FULL | 录音缓冲区已满。 | 103e41f4b71Sopenharmony_ci| AUDIO_ERROR_OCCUR | 发生了错误。 | 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ci 106e41f4b71Sopenharmony_ci### AudioCategory 107e41f4b71Sopenharmony_ci 108e41f4b71Sopenharmony_ci``` 109e41f4b71Sopenharmony_cienum AudioCategory 110e41f4b71Sopenharmony_ci``` 111e41f4b71Sopenharmony_ci 112e41f4b71Sopenharmony_ci**描述** 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ci音频类型(场景)。 115e41f4b71Sopenharmony_ci 116e41f4b71Sopenharmony_ci**起始版本:** 4.1 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 119e41f4b71Sopenharmony_ci| -------- | -------- | 120e41f4b71Sopenharmony_ci| AUDIO_IN_MEDIA | 媒体。 | 121e41f4b71Sopenharmony_ci| AUDIO_IN_COMMUNICATION | 通信。 | 122e41f4b71Sopenharmony_ci| AUDIO_IN_RINGTONE | 电话铃声。 | 123e41f4b71Sopenharmony_ci| AUDIO_IN_CALL | 呼叫。 | 124e41f4b71Sopenharmony_ci| AUDIO_MMAP_NOIRQ | Mmap模式 | 125e41f4b71Sopenharmony_ci| AUDIO_OFFLOAD | 低功耗 | 126e41f4b71Sopenharmony_ci| AUDIO_MULTI_CHANNEL | 多声道 | 127e41f4b71Sopenharmony_ci 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ci### AudioChannelMask 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ci``` 132e41f4b71Sopenharmony_cienum AudioChannelMask 133e41f4b71Sopenharmony_ci``` 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci**描述** 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ci音频通道掩码。 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ci定义音频声道的位置掩码。 140e41f4b71Sopenharmony_ci 141e41f4b71Sopenharmony_ci**起始版本:** 4.1 142e41f4b71Sopenharmony_ci 143e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 144e41f4b71Sopenharmony_ci| -------- | -------- | 145e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_FRONT_LEFT | 声道布局前左。 | 146e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_FRONT_RIGHT | 声道布局前右。 | 147e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_MONO | 单声道。 | 148e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_STEREO | 立体声,由左右声道组成。 | 149e41f4b71Sopenharmony_ci 150e41f4b71Sopenharmony_ci 151e41f4b71Sopenharmony_ci### AudioChannelMode 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ci``` 154e41f4b71Sopenharmony_cienum AudioChannelMode 155e41f4b71Sopenharmony_ci``` 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ci**描述** 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci音频播放的通道模式。 160e41f4b71Sopenharmony_ci 161e41f4b71Sopenharmony_ci**起始版本:** 4.1 162e41f4b71Sopenharmony_ci 163e41f4b71Sopenharmony_ci**注意:** 164e41f4b71Sopenharmony_ci 165e41f4b71Sopenharmony_ci下面的模式是针对双通道立体声的音频播放而设置,其他不支持。 166e41f4b71Sopenharmony_ci 167e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 168e41f4b71Sopenharmony_ci| -------- | -------- | 169e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_NORMAL | 正常模式,不做处理。 | 170e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_BOTH_LEFT | 两个声道全部为左声道声音。 | 171e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_BOTH_RIGHT | 两个声道全部为右声道声音。 | 172e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_EXCHANGE | 左右声道数据互换,左声道为右声道声音,右声道为左声道声音。 | 173e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_MIX | 左右两个声道输出为左右声道相加(混音)。 | 174e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_LEFT_MUTE | 左声道静音,右声道播放原右声道声音。 | 175e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_RIGHT_MUTE | 右声道静音,左声道播放原左声道声音。 | 176e41f4b71Sopenharmony_ci| AUDIO_CHANNEL_BOTH_MUTE | 左右声道均静音。 | 177e41f4b71Sopenharmony_ci 178e41f4b71Sopenharmony_ci 179e41f4b71Sopenharmony_ci### AudioDeviceType 180e41f4b71Sopenharmony_ci 181e41f4b71Sopenharmony_ci``` 182e41f4b71Sopenharmony_cienum AudioDeviceType 183e41f4b71Sopenharmony_ci``` 184e41f4b71Sopenharmony_ci 185e41f4b71Sopenharmony_ci**描述** 186e41f4b71Sopenharmony_ci 187e41f4b71Sopenharmony_ci音频设备类型。 188e41f4b71Sopenharmony_ci 189e41f4b71Sopenharmony_ci**起始版本:** 4.1 190e41f4b71Sopenharmony_ci 191e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 192e41f4b71Sopenharmony_ci| -------- | -------- | 193e41f4b71Sopenharmony_ci| AUDIO_LINEOUT | LINEOUT设备。 | 194e41f4b71Sopenharmony_ci| AUDIO_HEADPHONE | 耳机。 | 195e41f4b71Sopenharmony_ci| AUDIO_HEADSET | 头戴式耳机。 | 196e41f4b71Sopenharmony_ci| AUDIO_USB_HEADSET | USB头戴式耳机。 | 197e41f4b71Sopenharmony_ci| AUDIO_USB_HEADPHONE | USB耳机。 | 198e41f4b71Sopenharmony_ci| AUDIO_USBA_HEADSET | USB模拟头戴式耳机。 | 199e41f4b71Sopenharmony_ci| AUDIO_USBA_HEADPHONE | USB模拟耳机。 | 200e41f4b71Sopenharmony_ci| AUDIO_PRIMARY_DEVICE | 主音频设备。 | 201e41f4b71Sopenharmony_ci| AUDIO_USB_DEVICE | USB音频设备。 | 202e41f4b71Sopenharmony_ci| AUDIO_A2DP_DEVICE | 蓝牙音频设备。 | 203e41f4b71Sopenharmony_ci| AUDIO_HDMI_DEVICE | HDMI音频设备 | 204e41f4b71Sopenharmony_ci| AUDIO_ADAPTER_DEVICE | 声卡设备 | 205e41f4b71Sopenharmony_ci| AUDIO_DEVICE_UNKNOWN | 未知设备。 | 206e41f4b71Sopenharmony_ci 207e41f4b71Sopenharmony_ci 208e41f4b71Sopenharmony_ci### AudioDrainNotifyType 209e41f4b71Sopenharmony_ci 210e41f4b71Sopenharmony_ci``` 211e41f4b71Sopenharmony_cienum AudioDrainNotifyType 212e41f4b71Sopenharmony_ci``` 213e41f4b71Sopenharmony_ci 214e41f4b71Sopenharmony_ci**描述** 215e41f4b71Sopenharmony_ci 216e41f4b71Sopenharmony_ci音频数据结束类型。 217e41f4b71Sopenharmony_ci 218e41f4b71Sopenharmony_ci**起始版本:** 4.1 219e41f4b71Sopenharmony_ci 220e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 221e41f4b71Sopenharmony_ci| -------- | -------- | 222e41f4b71Sopenharmony_ci| AUDIO_DRAIN_NORMAL_MODE | 曲目的所有数据播放完就结束。 | 223e41f4b71Sopenharmony_ci| AUDIO_DRAIN_EARLY_MODE | 曲目的所有数据未播放完就结束,以便给音频服务做连续性曲目切换留出时间。 | 224e41f4b71Sopenharmony_ci 225e41f4b71Sopenharmony_ci 226e41f4b71Sopenharmony_ci### AudioEventType 227e41f4b71Sopenharmony_ci 228e41f4b71Sopenharmony_ci``` 229e41f4b71Sopenharmony_cienum AudioEventType 230e41f4b71Sopenharmony_ci``` 231e41f4b71Sopenharmony_ci 232e41f4b71Sopenharmony_ci**描述** 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ci音频事件类型。 235e41f4b71Sopenharmony_ci 236e41f4b71Sopenharmony_ci**起始版本:** 4.1 237e41f4b71Sopenharmony_ci 238e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 239e41f4b71Sopenharmony_ci| -------- | -------- | 240e41f4b71Sopenharmony_ci| AUDIO_DEVICE_ADD | 音频设备添加。 | 241e41f4b71Sopenharmony_ci| AUDIO_DEVICE_REMOVE | 音频设备移除。 | 242e41f4b71Sopenharmony_ci| AUDIO_LOAD_SUCCESS | 声卡加载成功。 | 243e41f4b71Sopenharmony_ci| AUDIO_LOAD_FAILURE | 声卡加载失败。 | 244e41f4b71Sopenharmony_ci| AUDIO_UNLOAD | 声卡卸载。 | 245e41f4b71Sopenharmony_ci| AUDIO_SERVICE_VALID | 音频服务可用。 | 246e41f4b71Sopenharmony_ci| AUDIO_SERVICE_INVALID | 音频服务不可用。 | 247e41f4b71Sopenharmony_ci| AUDIO_CAPTURE_THRESHOLD | 录音阈值上报。 | 248e41f4b71Sopenharmony_ci| AUDIO_EVENT_UNKNOWN | 未知事件。 | 249e41f4b71Sopenharmony_ci 250e41f4b71Sopenharmony_ci 251e41f4b71Sopenharmony_ci### AudioExtParamKey 252e41f4b71Sopenharmony_ci 253e41f4b71Sopenharmony_ci``` 254e41f4b71Sopenharmony_cienum AudioExtParamKey 255e41f4b71Sopenharmony_ci``` 256e41f4b71Sopenharmony_ci 257e41f4b71Sopenharmony_ci**描述** 258e41f4b71Sopenharmony_ci 259e41f4b71Sopenharmony_ci音频扩展参数键类型。 260e41f4b71Sopenharmony_ci 261e41f4b71Sopenharmony_ci**起始版本:** 4.1 262e41f4b71Sopenharmony_ci 263e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 264e41f4b71Sopenharmony_ci| -------- | -------- | 265e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_NONE | 分布式音频-无效事件。 | 266e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_VOLUME | 分布式音频-音量事件。 | 267e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_FOCUS | 分布式音频-焦点事件。 | 268e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_BUTTON | 分布式音频-媒体按钮事件。 | 269e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_EFFECT | 分布式音频-音频效果事件。 | 270e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_STATUS | 分布式音频-设备状态事件。 | 271e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_USB_DEVICE | USB设备类型( ARM 或 HIFI) | 272e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_PERF_INFO | 分布式音频-dsp加载事件。 | 273e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_MMI | 分布式音频-主机接口测试。 | 274e41f4b71Sopenharmony_ci| AUDIO_EXT_PARAM_KEY_LOWPOWER | 低电量事件。 | 275e41f4b71Sopenharmony_ci 276e41f4b71Sopenharmony_ci 277e41f4b71Sopenharmony_ci### AudioFormat 278e41f4b71Sopenharmony_ci 279e41f4b71Sopenharmony_ci``` 280e41f4b71Sopenharmony_cienum AudioFormat 281e41f4b71Sopenharmony_ci``` 282e41f4b71Sopenharmony_ci 283e41f4b71Sopenharmony_ci**描述** 284e41f4b71Sopenharmony_ci 285e41f4b71Sopenharmony_ci音频格式。 286e41f4b71Sopenharmony_ci 287e41f4b71Sopenharmony_ci**起始版本:** 4.1 288e41f4b71Sopenharmony_ci 289e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 290e41f4b71Sopenharmony_ci| -------- | -------- | 291e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_PCM_8_BIT | 8bit位宽PCM(Pulse Code Modulation)格式。 | 292e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_PCM_16_BIT | 16bit位宽PCM格式。 | 293e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_PCM_24_BIT | 24bit位宽PCM格式。 | 294e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_PCM_32_BIT | 32bit位宽PCM格式。 | 295e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_PCM_FLOAT | PCM浮点格式 | 296e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_MP3 | MP3格式 | 297e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_AAC_MAIN | AAC main格式 | 298e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_AAC_LC | AAC LC格式 | 299e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_AAC_LD | AAC LD格式 | 300e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_AAC_ELD | AAC ELD格式 | 301e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_AAC_HE_V1 | AAC HE_V1格式 | 302e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_AAC_HE_V2 | AAC HE_V2格式 | 303e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_G711A | PCM G711A格式 | 304e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_G711U | PCM G711u格式 | 305e41f4b71Sopenharmony_ci| AUDIO_FORMAT_TYPE_G726 | PCM G726格式 | 306e41f4b71Sopenharmony_ci 307e41f4b71Sopenharmony_ci 308e41f4b71Sopenharmony_ci### AudioInputType 309e41f4b71Sopenharmony_ci 310e41f4b71Sopenharmony_ci``` 311e41f4b71Sopenharmony_cienum AudioInputType 312e41f4b71Sopenharmony_ci``` 313e41f4b71Sopenharmony_ci 314e41f4b71Sopenharmony_ci**描述** 315e41f4b71Sopenharmony_ci 316e41f4b71Sopenharmony_ci音频输入类型. 317e41f4b71Sopenharmony_ci 318e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 319e41f4b71Sopenharmony_ci| -------- | -------- | 320e41f4b71Sopenharmony_ci| AUDIO_INPUT_DEFAULT_TYPE | 默认输入 | 321e41f4b71Sopenharmony_ci| AUDIO_INPUT_MIC_TYPE | 麦克风输入 | 322e41f4b71Sopenharmony_ci| AUDIO_INPUT_SPEECH_WAKEUP_TYPE | 语音唤醒输入 | 323e41f4b71Sopenharmony_ci| AUDIO_INPUT_VOICE_COMMUNICATION_TYPE | 通话 | 324e41f4b71Sopenharmony_ci| AUDIO_INPUT_VOICE_RECOGNITION_TYPE | 声音识别 | 325e41f4b71Sopenharmony_ci| AUDIO_INPUT_VOICE_UPLINK_TYPE | 上行输入 | 326e41f4b71Sopenharmony_ci| AUDIO_INPUT_VOICE_DOWNLINK_TYPE | 下行输入 | 327e41f4b71Sopenharmony_ci| AUDIO_INPUT_VOICE_CALL_TYPE | 电话 | 328e41f4b71Sopenharmony_ci| AUDIO_INPUT_CAMCORDER_TYPE | 摄像机输入 | 329e41f4b71Sopenharmony_ci 330e41f4b71Sopenharmony_ci 331e41f4b71Sopenharmony_ci### AudioPortDirection 332e41f4b71Sopenharmony_ci 333e41f4b71Sopenharmony_ci``` 334e41f4b71Sopenharmony_cienum AudioPortDirection 335e41f4b71Sopenharmony_ci``` 336e41f4b71Sopenharmony_ci 337e41f4b71Sopenharmony_ci**描述** 338e41f4b71Sopenharmony_ci 339e41f4b71Sopenharmony_ci音频端口的类型。 340e41f4b71Sopenharmony_ci 341e41f4b71Sopenharmony_cipackage ohos.hdi.audio.v2_0; 342e41f4b71Sopenharmony_ci 343e41f4b71Sopenharmony_ci**起始版本:** 4.1 344e41f4b71Sopenharmony_ci 345e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 346e41f4b71Sopenharmony_ci| -------- | -------- | 347e41f4b71Sopenharmony_ci| PORT_OUT | 音频输出端口。 | 348e41f4b71Sopenharmony_ci| PORT_IN | 音频输入端口。 | 349e41f4b71Sopenharmony_ci| PORT_OUT_IN | 音频输出输入端口。 | 350e41f4b71Sopenharmony_ci 351e41f4b71Sopenharmony_ci 352e41f4b71Sopenharmony_ci### AudioPortPassthroughMode 353e41f4b71Sopenharmony_ci 354e41f4b71Sopenharmony_ci``` 355e41f4b71Sopenharmony_cienum AudioPortPassthroughMode 356e41f4b71Sopenharmony_ci``` 357e41f4b71Sopenharmony_ci 358e41f4b71Sopenharmony_ci**描述** 359e41f4b71Sopenharmony_ci 360e41f4b71Sopenharmony_ci音频端口的数据透传模式。 361e41f4b71Sopenharmony_ci 362e41f4b71Sopenharmony_ci**起始版本:** 4.1 363e41f4b71Sopenharmony_ci 364e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 365e41f4b71Sopenharmony_ci| -------- | -------- | 366e41f4b71Sopenharmony_ci| PORT_PASSTHROUGH_LPCM | 立体声PCM。 | 367e41f4b71Sopenharmony_ci| PORT_PASSTHROUGH_RAW | HDMI透传。 | 368e41f4b71Sopenharmony_ci| PORT_PASSTHROUGH_HBR2LBR | 蓝光次世代音频降规格输出。 | 369e41f4b71Sopenharmony_ci| PORT_PASSTHROUGH_AUTO | 根据HDMI EDID能力自动匹配。 | 370e41f4b71Sopenharmony_ci 371e41f4b71Sopenharmony_ci 372e41f4b71Sopenharmony_ci### AudioPortPin 373e41f4b71Sopenharmony_ci 374e41f4b71Sopenharmony_ci``` 375e41f4b71Sopenharmony_cienum AudioPortPin 376e41f4b71Sopenharmony_ci``` 377e41f4b71Sopenharmony_ci 378e41f4b71Sopenharmony_ci**描述** 379e41f4b71Sopenharmony_ci 380e41f4b71Sopenharmony_ci音频端口上的Pin脚。 381e41f4b71Sopenharmony_ci 382e41f4b71Sopenharmony_ci**起始版本:** 4.1 383e41f4b71Sopenharmony_ci 384e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 385e41f4b71Sopenharmony_ci| -------- | -------- | 386e41f4b71Sopenharmony_ci| PIN_NONE | 无效端口。 | 387e41f4b71Sopenharmony_ci| PIN_OUT_SPEAKER | 喇叭输出。 | 388e41f4b71Sopenharmony_ci| PIN_OUT_HEADSET | 有线耳机输出。 | 389e41f4b71Sopenharmony_ci| PIN_OUT_LINEOUT | Lineout输出。 | 390e41f4b71Sopenharmony_ci| PIN_OUT_HDMI | HDMI输出。 | 391e41f4b71Sopenharmony_ci| PIN_OUT_USB | USB输出。 | 392e41f4b71Sopenharmony_ci| PIN_OUT_USB_EXT | USB外部声卡输出。 | 393e41f4b71Sopenharmony_ci| PIN_OUT_EARPIECE | 有线耳机输出。 | 394e41f4b71Sopenharmony_ci| PIN_OUT_BLUETOOTH_SCO | 蓝牙SCO输出 | 395e41f4b71Sopenharmony_ci| PIN_OUT_DAUDIO_DEFAULT | 音频默认输出 | 396e41f4b71Sopenharmony_ci| PIN_OUT_HEADPHONE | 有线耳机输出。 | 397e41f4b71Sopenharmony_ci| PIN_OUT_USB_HEADSET | ARM USB输出 | 398e41f4b71Sopenharmony_ci| PIN_OUT_BLUETOOTH_A2DP | 蓝牙A2DP输出 | 399e41f4b71Sopenharmony_ci| PIN_IN_MIC | 麦克风输入 | 400e41f4b71Sopenharmony_ci| PIN_IN_HS_MIC | 耳机麦克风输入 | 401e41f4b71Sopenharmony_ci| PIN_IN_LINEIN | Linein输入。 | 402e41f4b71Sopenharmony_ci| PIN_IN_USB_EXT | USB外部声卡输入。 | 403e41f4b71Sopenharmony_ci| PIN_IN_BLUETOOTH_SCO_HEADSET | 蓝牙SCO耳机输入 | 404e41f4b71Sopenharmony_ci| PIN_IN_DAUDIO_DEFAULT | 音频默认输入 | 405e41f4b71Sopenharmony_ci| PIN_IN_USB_HEADSET | ARM USB输入 | 406e41f4b71Sopenharmony_ci 407e41f4b71Sopenharmony_ci 408e41f4b71Sopenharmony_ci### AudioPortRole 409e41f4b71Sopenharmony_ci 410e41f4b71Sopenharmony_ci``` 411e41f4b71Sopenharmony_cienum AudioPortRole 412e41f4b71Sopenharmony_ci``` 413e41f4b71Sopenharmony_ci 414e41f4b71Sopenharmony_ci**描述** 415e41f4b71Sopenharmony_ci 416e41f4b71Sopenharmony_ci音频端口角色。 417e41f4b71Sopenharmony_ci 418e41f4b71Sopenharmony_ci**起始版本:** 4.1 419e41f4b71Sopenharmony_ci 420e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 421e41f4b71Sopenharmony_ci| -------- | -------- | 422e41f4b71Sopenharmony_ci| AUDIO_PORT_UNASSIGNED_ROLE | 未指定端口角色。 | 423e41f4b71Sopenharmony_ci| AUDIO_PORT_SOURCE_ROLE | 指定端口为发送端角色。 | 424e41f4b71Sopenharmony_ci| AUDIO_PORT_SINK_ROLE | 指定端口为接受端角色。 | 425e41f4b71Sopenharmony_ci 426e41f4b71Sopenharmony_ci 427e41f4b71Sopenharmony_ci### AudioPortType 428e41f4b71Sopenharmony_ci 429e41f4b71Sopenharmony_ci``` 430e41f4b71Sopenharmony_cienum AudioPortType 431e41f4b71Sopenharmony_ci``` 432e41f4b71Sopenharmony_ci 433e41f4b71Sopenharmony_ci**描述** 434e41f4b71Sopenharmony_ci 435e41f4b71Sopenharmony_ci音频端口类型。 436e41f4b71Sopenharmony_ci 437e41f4b71Sopenharmony_ci**起始版本:** 4.1 438e41f4b71Sopenharmony_ci 439e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 440e41f4b71Sopenharmony_ci| -------- | -------- | 441e41f4b71Sopenharmony_ci| AUDIO_PORT_UNASSIGNED_TYPE | 未指定端口类型。 | 442e41f4b71Sopenharmony_ci| AUDIO_PORT_DEVICE_TYPE | 指定端口为设备类型。 | 443e41f4b71Sopenharmony_ci| AUDIO_PORT_MIX_TYPE | 指定端口为复合类型。 | 444e41f4b71Sopenharmony_ci| AUDIO_PORT_SESSION_TYPE | 指定端口为会话类型。 | 445e41f4b71Sopenharmony_ci 446e41f4b71Sopenharmony_ci 447e41f4b71Sopenharmony_ci### AudioSampleFormat 448e41f4b71Sopenharmony_ci 449e41f4b71Sopenharmony_ci``` 450e41f4b71Sopenharmony_cienum AudioSampleFormat 451e41f4b71Sopenharmony_ci``` 452e41f4b71Sopenharmony_ci 453e41f4b71Sopenharmony_ci**描述** 454e41f4b71Sopenharmony_ci 455e41f4b71Sopenharmony_ci原始音频样本格式。 456e41f4b71Sopenharmony_ci 457e41f4b71Sopenharmony_ci**起始版本:** 4.1 458e41f4b71Sopenharmony_ci 459e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 460e41f4b71Sopenharmony_ci| -------- | -------- | 461e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S8 | 8bit位宽有符号交织样本。 | 462e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S8P | 8bit位宽有符号非交织样本。 | 463e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U8 | 8bit位宽无符号交织样本。 | 464e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U8P | 8bit位宽无符号非交织样本。 | 465e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S16 | 16bit位宽有符号交织样本。 | 466e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S16P | 16bit位宽有符号非交织样本。 | 467e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U16 | 16bit位宽无符号符号交织样本。 | 468e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U16P | 16bit位宽无符号符号非交织样本。 | 469e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S24 | 24bit位宽有符号交织样本。 | 470e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S24P | 24bit位宽有符号非交织样本。 | 471e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U24 | 24bit位宽无符号符号交织样本。 | 472e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U24P | 24bit位宽无符号非交织样本。 | 473e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S32 | 32bit位宽有符号交织样本。 | 474e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S32P | 32bit位宽有符号非交织样本。 | 475e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U32 | 32bit位宽无符号交织样本。 | 476e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U32P | 32bit位宽无符号非交织样本。 | 477e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S64 | 64bit位宽有符号交织样本。 | 478e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_S64P | 64bit位宽有符号非交织样本。 | 479e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U64 | 64bit位宽无符号交织样本。 | 480e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_U64P | 64bit位宽无符号非交织样本。 | 481e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_F32 | 32bit位宽浮点型交织样本。 | 482e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_F32P | 32bit位宽浮点型非交织样本。 | 483e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_F64 | 64bit位宽双精度浮点型交织样本。 | 484e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_FORMAT_F64P | 64bit位宽双精度浮点型非交织样本。 | 485e41f4b71Sopenharmony_ci 486e41f4b71Sopenharmony_ci 487e41f4b71Sopenharmony_ci### AudioSampleRatesMask 488e41f4b71Sopenharmony_ci 489e41f4b71Sopenharmony_ci``` 490e41f4b71Sopenharmony_cienum AudioSampleRatesMask 491e41f4b71Sopenharmony_ci``` 492e41f4b71Sopenharmony_ci 493e41f4b71Sopenharmony_ci**描述** 494e41f4b71Sopenharmony_ci 495e41f4b71Sopenharmony_ci音频采样频率掩码。 496e41f4b71Sopenharmony_ci 497e41f4b71Sopenharmony_ci**起始版本:** 4.1 498e41f4b71Sopenharmony_ci 499e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 500e41f4b71Sopenharmony_ci| -------- | -------- | 501e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_8000 | 8K 采样频率。 | 502e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_12000 | 12K 采样频率。 | 503e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_11025 | 11.025K 采样频率。 | 504e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_16000 | 16K 采样频率。 | 505e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_22050 | 22.050K 采样频率。 | 506e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_24000 | 24K 采样频率。 | 507e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_32000 | 32K 采样频率。 | 508e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_44100 | 44.1K 采样频率。 | 509e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_48000 | 48K 采样频率。 | 510e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_64000 | 64K 采样频率。 | 511e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_96000 | 96K 采样频率。 | 512e41f4b71Sopenharmony_ci| AUDIO_SAMPLE_RATE_MASK_INVALID | 无效的采样频率。 | 513e41f4b71Sopenharmony_ci 514e41f4b71Sopenharmony_ci 515e41f4b71Sopenharmony_ci### AudioSessionType 516e41f4b71Sopenharmony_ci 517e41f4b71Sopenharmony_ci``` 518e41f4b71Sopenharmony_cienum AudioSessionType 519e41f4b71Sopenharmony_ci``` 520e41f4b71Sopenharmony_ci 521e41f4b71Sopenharmony_ci**描述** 522e41f4b71Sopenharmony_ci 523e41f4b71Sopenharmony_ci端口会话类型。 524e41f4b71Sopenharmony_ci 525e41f4b71Sopenharmony_ci**起始版本:** 4.1 526e41f4b71Sopenharmony_ci 527e41f4b71Sopenharmony_ci| 枚举值 | 描述 | 528e41f4b71Sopenharmony_ci| -------- | -------- | 529e41f4b71Sopenharmony_ci| AUDIO_OUTPUT_STAGE_SESSION | 会话绑定到指定输出流。 | 530e41f4b71Sopenharmony_ci| AUDIO_OUTPUT_MIX_SESSION | 会话绑定到特定音轨。 | 531e41f4b71Sopenharmony_ci| AUDIO_ALLOCATE_SESSION | 会话ID需重新申请。 | 532e41f4b71Sopenharmony_ci| AUDIO_INVALID_SESSION | 无效会话类型。 | 533