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