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; 17 18/** 19 * @brief Defines audio effect info for the effect loading. 20 */ 21struct EffectInfo { 22 String libName; /**< assign the effect library name which is used to create contoller */ 23 String effectId; /**< effectId of the effect */ 24 int ioDirection; /**< Identify the direction of the effect */ 25}; 26 27/** 28 * @brief Defines effect contoller info including which library its belongs to and it's effectId. 29 */ 30struct ControllerId { 31 String libName; /**< assign the effect library name which is used to create contoller */ 32 String effectId; /**< effectId of the effect */ 33}; 34 35/** 36 * @brief Defines the effect controller descriptor. 37 */ 38struct EffectControllerDescriptor { 39 String effectId; /**< effectId of the effect controller */ 40 String effectName; /**< Name of the effect controller */ 41 String libName; /**< Name of the effect library*/ 42 String supplier; /**< Name of the effect supplier */ 43}; 44 45/** 46 * @brief data point type tag, the type is using on demand. 47 */ 48enum AudioEffectBufferTag { 49 EFFECT_BUFFER_VOID_TYPE = 0, /**< raw audio data point to the start of the buffer */ 50 EFFECT_BUFFER_FLOAT_SIGNED_32 = 1 << 0, /**< 32bit float type audio data point to the start of the buffer */ 51 EFFECT_BUFFER_SINGED_32 = 1 << 1, /**< 32bit signed type audio data point to the start of the buffer */ 52 EFFECT_BUFFER_SIGNED_16 = 1 << 2, /**< 16bit signed type audio data point to the start of the buffer */ 53 EFFECT_BUFFER_UNSIGNED_8 = 1 << 3, /**< 8bit unsigned type audio data point to the start of the buffer */ 54}; 55 56/** 57 * @brief Defines audio effect process in buffer and out buffer. 58 */ 59struct AudioEffectBuffer { 60 unsigned int frameCount; /**< frame count in the frame buffer */ 61 int datatag; /** data point type tag for using simplify see {@link AudioEffectBufferTag} */ 62 byte[] rawData; /**< audio data point to the start of the buffer, the type is defined by datatag*/ 63}; 64 65/** 66 * @brief Defines effect contoller command index. 67 */ 68enum EffectCommandTableIndex { 69 AUDIO_EFFECT_COMMAND_INIT_CONTOLLER, /* Init effect controller */ 70 AUDIO_EFFECT_COMMAND_SET_CONFIG, /* Set configuration */ 71 AUDIO_EFFECT_COMMAND_GET_CONFIG, /* Get configuration */ 72 AUDIO_EFFECT_COMMAND_RESET, /* Reset effect controller */ 73 AUDIO_EFFECT_COMMAND_ENABLE, /* Enable effect proccess */ 74 AUDIO_EFFECT_COMMAND_DISABLE, /* Disable effect proccess */ 75 AUDIO_EFFECT_COMMAND_SET_PARAM, /* Set parameters */ 76 AUDIO_EFFECT_COMMAND_GET_PARAM, /* Get parameters */ 77}; 78