/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ohos.hdi.audio.effect.v1_0; import ohos.hdi.audio.effect.v1_0.EffectTypes; interface IEffectControl { /** * @brief Process the audio raw data. * the input and output buffer have to be specificed, if they are not specified,the process have to use the * data process function which is provided by the command. * * @param control Indicates the pointer to the effect control to operate. * @param input Indicates the buffer for original data. * @param output Indicates the buffer for output data. * * @return Returns 0 if the operation is successful; returns a negative value otherwise. * * @since 4.0 * @version 1.0 */ EffectProcess([in] struct AudioEffectBuffer input, [out] struct AudioEffectBuffer output); /** * @brief Send the effect processing command. * * @param control Indicates the pointer to the effect control to operate. * @param cmdId Command index used to match command options in the command table. * @param cmdData Data comes from the system service. * @param cmdDataLen to the length of the cmdData. * @param replyData Data comes from vendor. * @param replyDataLen Indicates the pointer to the length of the replyData. * * @return Returns 0 if the operation is successful; returns a negative value otherwise. * * @since 4.0 * @version 1.0 */ SendCommand([in] unsigned int cmdId, [in] byte[] cmdData, [out] byte[] replyData); /** * @brief Get the descriptor of the effect. * * @param control Indicates the pointer to the effect control to operate. * @param desc Indicates the specified effect descriptor. * * @return Returns 0 if the operation is successful; returns a negative value otherwise. * * @since 4.0 * @version 1.0 */ GetEffectDescriptor([out] struct EffectControllerDescriptor desc); /** * @brief Reverse the audio processed data. * the input and output buffer have to be specificed, if they are not specified,the reverse have to use the * data reverse function which is provided by the command. * * @param control Indicates the pointer to the effect control to operate. * @param input Indicates the buffer for input data. * @param output Indicates the buffer for output data. * * @return Returns 0 if the operation is successful; returns a negative value otherwise. * * @since 4.0 * @version 1.0 */ EffectReverse([in] struct AudioEffectBuffer input, [out] struct AudioEffectBuffer output); }