harmony 鸿蒙native_audio_routing_manager.h
native_audio_routing_manager.h
Overview
The native_audio_routing_manager.h file declares the functions related to an audio routing manager.
You can use the functions to create an audio routing manager, register and deregister a callback to listen for device connection status changes, and release devices.
Library: libohaudio.so
File to include: <ohaudio/native_audio_routing_manager.h>
System capability: SystemCapability.Multimedia.Audio.Core
Since: 12
Related module: OHAudio
Summary
Types
Name | Description |
---|---|
typedef struct OH_AudioRoutingManager OH_AudioRoutingManager | Defines the struct of an audio routing manager, which is used for routing and device-related functions. |
typedef int32_t (*OH_AudioRoutingManager_OnDeviceChangedCallback)(OH_AudioDevice_ChangeType type, OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray) | Defines a pointer to the callback function that returns the changed audio device descriptor (possibly multiple descriptors). |
typedef void (*OH_AudioRoutingManager_OnDeviceBlockStatusCallback)(OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray, OH_AudioDevice_BlockStatus status, void *userData) | Defines a pointer to the callback function that returns the blocked status of one or more audio devices. |
Functions
Name | Description |
---|---|
OH_AudioCommon_Result OH_AudioManager_GetAudioRoutingManager(OH_AudioRoutingManager **audioRoutingManager) | Obtains the handle to an audio routing manager. The handle should be set as the first parameter in the routing-related functions. |
OH_AudioCommon_Result OH_AudioRoutingManager_GetDevices(OH_AudioRoutingManager *audioRoutingManager, OH_AudioDevice_Flag deviceFlag, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray) | Obtains available devices based on the device flag. |
OH_AudioCommon_Result OH_AudioRoutingManager_GetAvailableDevices(OH_AudioRoutingManager *audioRoutingManager, OH_AudioDevice_Usage deviceUsage, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray) | Obtains the available audio devices. |
OH_AudioCommon_Result OH_AudioRoutingManager_GetPreferredOutputDevice(OH_AudioRoutingManager *audioRoutingManager, OH_AudioStream_Usage streamUsage, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray) | Obtains the output device with the highest priority based on the usage scenario of an audio output stream. |
OH_AudioCommon_Result OH_AudioRoutingManager_GetPreferredInputDevice(OH_AudioRoutingManager *audioRoutingManager, OH_AudioStream_SourceType sourceType, OH_AudioDeviceDescriptorArray **audioDeviceDescriptorArray) | Obtains the input device with the highest priority based on the usage scenario of an audio input stream. |
OH_AudioCommon_Result OH_AudioRoutingManager_RegisterDeviceChangeCallback(OH_AudioRoutingManager *audioRoutingManager, OH_AudioDevice_Flag deviceFlag, OH_AudioRoutingManager_OnDeviceChangedCallback callback) | Registers a callback to listen for device changes of an audio routing manager. |
OH_AudioCommon_Result OH_AudioRoutingManager_UnregisterDeviceChangeCallback(OH_AudioRoutingManager *audioRoutingManager, OH_AudioRoutingManager_OnDeviceChangedCallback callback) | Unregisters the callback used to listen for device changes of an audio routing manager. |
OH_AudioCommon_Result OH_AudioRoutingManager_ReleaseDevices(OH_AudioRoutingManager *audioRoutingManager, OH_AudioDeviceDescriptorArray *audioDeviceDescriptorArray) | Releases audio devices available for an audio routing manager. |
OH_AudioCommon_Result OH_AudioRoutingManager_IsMicBlockDetectionSupported(OH_AudioRoutingManager *audioRoutingManager, bool *supported) | Checks whether the current device supports microphone blocking detection. |
OH_AudioCommon_Result OH_AudioRoutingManager_SetMicBlockStatusCallback(OH_AudioRoutingManager *audioRoutingManager, OH_AudioRoutingManager_OnDeviceBlockStatusCallback callback, void *userData) | Sets a callback function to be invoked when the microphone’s blocked status is changed. |
你可能感兴趣的鸿蒙文章
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框自动聚焦