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 16package ohos.hdi.audio.effect.v1_0; 17import ohos.hdi.audio.effect.v1_0.EffectTypes; 18 19interface IEffectControl { 20 /** 21 * @brief Process the audio raw data. 22 * the input and output buffer have to be specificed, if they are not specified,the process have to use the 23 * data process function which is provided by the command. 24 * 25 * @param input Indicates the buffer for original data. 26 * @param output Indicates the buffer for output data. 27 * 28 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 29 * 30 * @since 4.0 31 * @version 1.0 32 */ 33 EffectProcess([in] struct AudioEffectBuffer input, [out] struct AudioEffectBuffer output); 34 35 /** 36 * @brief Send the effect processing command. 37 * 38 * @param cmdId Command index used to match command options in the command table. 39 * @param cmdData Data comes from the system service. 40 * @param replyData Data comes from vendor. 41 * 42 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 43 * 44 * @since 4.0 45 * @version 1.0 46 */ 47 SendCommand([in] unsigned int cmdId, [in] byte[] cmdData, [out] byte[] replyData); 48 49 /** 50 * @brief Get the descriptor of the effect. 51 * 52 * @param desc Indicates the specified effect descriptor. 53 * 54 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 55 * 56 * @since 4.0 57 * @version 1.0 58 */ 59 GetEffectDescriptor([out] struct EffectControllerDescriptor desc); 60 61 /** 62 * @brief Reverse the audio processed data. 63 * the input and output buffer have to be specificed, if they are not specified,the reverse have to use the 64 * data reverse function which is provided by the command. 65 * 66 * @param input Indicates the buffer for input data. 67 * @param output Indicates the buffer for output data. 68 * 69 * @return Returns <b>0</b> if the operation is successful; returns a negative value otherwise. 70 * 71 * @since 4.0 72 * @version 1.0 73 */ 74 EffectReverse([in] struct AudioEffectBuffer input, [out] struct AudioEffectBuffer output); 75}