1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup OHAudio 18 * @{ 19 * 20 * @brief Provide the definition of the C interface for the audio module. 21 * 22 * @syscap SystemCapability.Multimedia.Audio.Core 23 * 24 * @since 12 25 * @version 1.0 26 */ 27 28 /** 29 * @file native_audio_manager.h 30 * 31 * @brief Declare audio manager related interfaces. 32 * 33 * @library libohaudio.so 34 * @syscap SystemCapability.Multimedia.Audio.Core 35 * @since 12 36 * @version 1.0 37 */ 38 #ifndef NATIVE_AUDIO_MANAGER_H 39 #define NATIVE_AUDIO_MANAGER_H 40 41 #include "native_audio_common.h" 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /** 47 * @brief Declare the audio manager. 48 * The handle of audio manager is used for audio management related functions. 49 * 50 * @since 12 51 */ 52 typedef struct OH_AudioManager OH_AudioManager; 53 54 /** 55 * @brief Get audio manager handle. 56 * 57 * @param audioManager the {@link OH_AudioManager} handle received from this function. 58 * @return Function result code: 59 * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. 60 * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: 61 * 1.The param of audioManager is nullptr; 62 * @since 12 63 */ 64 OH_AudioCommon_Result OH_GetAudioManager(OH_AudioManager **audioManager); 65 66 /** 67 * @brief Get audio scene. 68 * @param audioManager the {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}. 69 * @param scene the {@link OH_AudioScene} pointer to receive the result. 70 * @return Function result code: 71 * {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful. 72 * {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}: 73 * 1.The param of audioManager is nullptr; 74 * 2.The param of scene is nullptr. 75 * @since 12 76 */ 77 OH_AudioCommon_Result OH_GetAudioScene(OH_AudioManager* manager, OH_AudioScene *scene); 78 79 #ifdef __cplusplus 80 } 81 #endif 82 /** @} */ 83 #endif // NATIVE_AUDIO_ROUTING_MANAGER_H