native_audio_stream_manager.h
Overview
The file declares the functions related to an audio stream manager.
You can call the functions to create an audio stream manager and set and manage audio streams.
File to include: <ohaudio/native_audio_stream_manager.h>
Library: libohaudio.so
System capability: SystemCapability.Multimedia.Audio.Core
Since: 19
Related module: OHAudio
Summary
Structs
| Name | typedef Keyword | Description |
|---|---|---|
| OH_AudioStreamManager | OH_AudioStreamManager | Describes an audio stream manager, which is used for audio stream management. |
Functions
Function Description
OH_AudioManager_GetAudioStreamManager()
OH_AudioCommon_Result OH_AudioManager_GetAudioStreamManager(OH_AudioStreamManager **streamManager)
Description
Obtains the handle to the audio stream manager.
Since: 19
Parameters
| Name | Description |
|---|---|
| OH_AudioStreamManager **streamManager | Double pointer to the audio stream manager. |
Returns
| Type | Description |
|---|---|
| OH_AudioCommon_Result | AUDIOCOMMON_RESULT_SUCCESS = 0: The function is executed successfully. AUDIOCOMMON_RESULT_ERROR_SYSTEM = 6800301: The system status is incorrect. |
OH_AudioStreamManager_GetDirectPlaybackSupport()
OH_AudioCommon_Result OH_AudioStreamManager_GetDirectPlaybackSupport(OH_AudioStreamManager *audioStreamManager, OH_AudioStreamInfo *streamInfo, OH_AudioStream_Usage usage, OH_AudioStream_DirectPlaybackMode *directPlaybackMode)
Description
Obtains the direct playback mode supported by an audio stream.
Since: 19
Parameters
| Name | Description |
|---|---|
| OH_AudioStreamManager *audioStreamManager | Handle to the audio stream manager. The handle is obtained by calling OH_AudioManager_GetAudioStreamManager. |
| OH_AudioStreamInfo *streamInfo | Pointer to the audio stream information. |
| OH_AudioStream_Usage usage | Usage scenario of the audio stream. |
| OH_AudioStream_DirectPlaybackMode *directPlaybackMode | Pointer to OH_AudioStream_DirectPlaybackMode, which is used to receive the direct playback mode supported. |
Returns
| Type | Description |
|---|---|
| OH_AudioCommon_Result | AUDIOCOMMON_RESULT_SUCCESS = 0: The function is executed successfully. AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM = 6800101: 1. The audioStreamManager parameter is nullptr. 2. The streamInfo parameter is nullptr. 3. The usage parameter is invalid. 4. The directPlaybackMode parameter is nullptr. |
OH_AudioStreamManager_IsAcousticEchoCancelerSupported()
OH_AudioCommon_Result OH_AudioStreamManager_IsAcousticEchoCancelerSupported(OH_AudioStreamManager *streamManager, OH_AudioStream_SourceType sourceType, bool *supported)
Description
Checks whether the audio stream of the specified source type supports acoustic echo cancellation.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_AudioStreamManager *streamManager | Handle to the audio stream manager. The handle is obtained by calling OH_AudioManager_GetAudioStreamManager. |
| OH_AudioStream_SourceType sourceType | Usage scenario (OH_AudioStream_SourceType) of the audio input stream. |
| bool *supported | Pointer to the result for the support of acoustic echo cancellation. true if supported, false otherwise. |
Returns
| Type | Description |
|---|---|
| OH_AudioCommon_Result | AUDIOCOMMON_RESULT_SUCCESS = 0: The function is executed successfully. AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM = 6800101: 1. The audioStreamManager parameter is nullptr. 2. The sourceType parameter is invalid. 3. The supported parameter is nullptr. |
OH_AudioStreamManager_IsFastPlaybackSupported()
bool OH_AudioStreamManager_IsFastPlaybackSupported(OH_AudioStreamManager *streamManager, OH_AudioStreamInfo *streamInfo, OH_AudioStream_Usage usage)
Description
Checks whether the current device supports low-latency playback for the specified audio stream information and usage scenario.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_AudioStreamManager *streamManager | Handle to the audio stream manager. The handle is obtained by calling OH_AudioManager_GetAudioStreamManager. |
| OH_AudioStreamInfo *streamInfo | Pointer to the audio stream information. |
| OH_AudioStream_Usage usage | Usage scenario of the audio stream. |
Returns
| Type | Description |
|---|---|
| bool | Check result for the support of low-latency playback. true if supported, false otherwise. |
OH_AudioStreamManager_IsFastRecordingSupported()
bool OH_AudioStreamManager_IsFastRecordingSupported(OH_AudioStreamManager *streamManager, OH_AudioStreamInfo *streamInfo, OH_AudioStream_SourceType source)
Description
Checks whether the current device supports low-latency recording for the specified audio stream information and usage scenario.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_AudioStreamManager *streamManager | Handle to the audio stream manager. The handle is obtained by calling OH_AudioManager_GetAudioStreamManager. |
| OH_AudioStreamInfo *streamInfo | Pointer to the audio stream information. |
| OH_AudioStream_SourceType source | Usage scenario of the audio stream. |
Returns
| Type | Description |
|---|---|
| bool | Check result for the support of low-latency recording. true if supported, false otherwise. |
OH_AudioStreamManager_IsIntelligentNoiseReductionEnabledForCurrentDevice()
bool OH_AudioStreamManager_IsIntelligentNoiseReductionEnabledForCurrentDevice(OH_AudioStreamManager *streamManager, OH_AudioStream_SourceType source)
Description
Checks whether the intelligent noise reduction feature is enabled for the audio stream of the specified source type.
Since: 21
Parameters
| Name | Description |
|---|---|
| OH_AudioStreamManager *streamManager | Handle to the audio stream manager. which is obtained by calling OH_AudioManager_GetAudioStreamManager. |
| OH_AudioStream_SourceType source | Audio stream usage scenario determined based on the audio device and pipe type. |
Returns
| Type | Description |
|---|---|
| bool | Check result for whether the intelligent noise reduction feature is enabled. true if enabled, and false otherwise. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-native-audiostreambuilder-h
openharmony 鸿蒙 capi-ohaudiosuite
openharmony 鸿蒙 js-apis-inner-multimedia-systemSoundPlayer
openharmony 鸿蒙 arkts-apis-audio-i
openharmony 鸿蒙 arkts-apis-audio-AudioManager
openharmony 鸿蒙 capi-ohaudiosuite-oh-audiosuite-spacerenderpositionparams