1/*
2 * Copyright (c) 2023 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 HdiAudio
18 * @{
19 *
20 * @brief Provides unified APIs for audio services to access audio drivers.
21 *
22 * An audio service can obtain an audio driver object or agent and then call APIs provided by this object or agent to
23 * access different types of audio devices based on the audio IDs, thereby obtaining audio information,
24 * subscribing to or unsubscribing from audio data, enabling or disabling an audio,
25 * setting the audio data reporting mode, and setting audio options such as the accuracy and measurement range.
26 *
27 * @version 1.0
28 */
29
30package ohos.hdi.distributed_audio.audio.v1_0;
31
32import ohos.hdi.distributed_audio.audio.v1_0.AudioTypes;
33
34/**
35 * @brief Called when an event defined in {@link AudioCallbackType} occurs.
36 *
37 * @param AudioCallbackType Indicates the occurred event that triggers this callback.
38 * @param reserved Indicates the pointer to a reserved field.
39 * @param cookie Indicates the pointer to the cookie for data transmission.
40 * @return Returns <b>0</b> if the callback is successfully executed; returns a negative value otherwise.
41 * @see RegCallback
42 */
43[callback] interface IAudioCallback {
44    RenderCallback([in] enum AudioCallbackType type, [out] byte reserved, [out] byte cookie);
45    ParamCallback([in] enum AudioExtParamKey key, [in] String condition, [in] String value, [out] byte reserved, [in] byte cookie);
46}
47