1/* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17/************************************************************************************************** 18 * Equalizer functions 19 ****************************/ 20extern void android_eq_init(audio_session_t sessionId, IEqualizer* ieq); 21 22extern android::status_t android_eq_setParam(const android::sp<android::AudioEffect>& pFx, 23 int32_t param, int32_t param2, void *pValue); 24 25extern android::status_t android_eq_getParam(const android::sp<android::AudioEffect>& pFx, 26 int32_t param, int32_t param2, void *pValue); 27 28/************************************************************************************************** 29 * BassBoost functions 30 ****************************/ 31extern void android_bb_init(audio_session_t sessionId, IBassBoost* ibb); 32 33extern android::status_t android_bb_setParam(const android::sp<android::AudioEffect>& pFx, 34 int32_t param, void *pValue); 35 36extern android::status_t android_bb_getParam(const android::sp<android::AudioEffect>& pFx, 37 int32_t param, void *pValue); 38 39/************************************************************************************************** 40 * Virtualizer functions 41 ****************************/ 42extern void android_virt_init(audio_session_t sessionId, IVirtualizer* ivi); 43 44extern android::status_t android_virt_setParam(const android::sp<android::AudioEffect>& pFx, 45 int32_t param, void *pValue); 46 47extern android::status_t android_virt_getParam(const android::sp<android::AudioEffect>& pFx, 48 int32_t param, void *pValue); 49 50/************************************************************************************************** 51 * PresetReverb functions 52 ****************************/ 53extern void android_prev_init(IPresetReverb* ipr); 54 55extern android::status_t android_prev_setPreset(const android::sp<android::AudioEffect>& pFx, 56 uint16_t preset); 57 58extern android::status_t android_prev_getPreset(const android::sp<android::AudioEffect>& pFx, 59 uint16_t* preset); 60 61/************************************************************************************************** 62 * EnvironmentalReverb functions 63 ****************************/ 64extern void android_erev_init(IEnvironmentalReverb* ier); 65 66extern android::status_t android_erev_setParam(const android::sp<android::AudioEffect>& pFx, 67 int32_t param, void *pValue); 68 69extern android::status_t android_erev_getParam(const android::sp<android::AudioEffect>& pFx, 70 int32_t param, void *pValue); 71 72/************************************************************************************************** 73 * AEC functions 74 ****************************/ 75extern void android_aec_init(audio_session_t sessionId, IAndroidAcousticEchoCancellation* iaec); 76 77/************************************************************************************************** 78 * AGC functions 79 ****************************/ 80extern void android_agc_init(audio_session_t sessionId, IAndroidAutomaticGainControl* iagc); 81 82/************************************************************************************************** 83 * NS functions 84 ****************************/ 85extern void android_ns_init(audio_session_t sessionId, IAndroidNoiseSuppression* ins); 86 87/************************************************************************************************** 88 * Generic Effect functions 89 ****************************/ 90extern SLresult android_genericFx_queryNumEffects(SLuint32 *pNumSupportedAudioEffects); 91 92extern SLresult android_genericFx_queryEffect(SLuint32 index, effect_descriptor_t* pDescriptor); 93 94extern SLresult android_genericFx_createEffect(IAndroidEffect* iae, SLInterfaceID pUuid, 95 audio_session_t sessionId); 96 97extern SLresult android_genericFx_releaseEffect(IAndroidEffect* iae, SLInterfaceID pUuid); 98 99extern SLresult android_genericFx_setEnabled(IAndroidEffect* iae, SLInterfaceID pUuid, 100 SLboolean enabled); 101 102extern SLresult android_genericFx_isEnabled(IAndroidEffect* iae, SLInterfaceID pUuid, 103 SLboolean *pEnabled); 104 105extern SLresult android_genericFx_sendCommand(IAndroidEffect* iae, SLInterfaceID pUuid, 106 SLuint32 command, SLuint32 commandSize, void* pCommandData, 107 SLuint32 *replySize, void *pReplyData); 108 109extern bool android_genericFx_hasEffect(IAndroidEffect* iae, SLInterfaceID pUuid); 110 111 112/************************************************************************************************** 113 * EffectSend functions 114 ****************************/ 115/** 116 * sendLevel is the total energy going to the send bus. This implies that the volume attenuation 117 * should be combined with the send level for the aux level to follow volume changes. 118 */ 119extern android::status_t android_fxSend_attach(CAudioPlayer* ap, bool attach, 120 const android::sp<android::AudioEffect>& pFx, SLmillibel sendLevel); 121 122/** 123 * sendLevel is the total energy going to the send bus. This implies that the volume attenuation 124 * should be combined with the send level for the aux level to follow volume changes. 125 * This one is used by Android-specific APIs, not portable Khronos APIs. 126 */ 127extern SLresult android_fxSend_attachToAux(CAudioPlayer* ap, SLInterfaceID pUuid, 128 SLboolean attach, SLmillibel sendLevel); 129 130/** 131 * sendLevel is the total energy going to the send bus. This implies that the volume attenuation 132 * should be combined with the send level for the aux level to follow volume changes. 133 */ 134extern android::status_t android_fxSend_setSendLevel(CAudioPlayer* ap, SLmillibel sendLevel); 135 136/************************************************************************************************** 137 * Effect-agnostic functions 138 ****************************/ 139extern android::status_t android_fx_setParam(const android::sp<android::AudioEffect>& pFx, 140 int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize); 141 142extern android::status_t android_fx_getParam(const android::sp<android::AudioEffect>& pFx, 143 int32_t param, uint32_t paramSizeMax, void *pValue, uint32_t valueSize); 144 145extern SLresult android_fx_statusToResult(android::status_t status); 146 147extern bool android_fx_initEffectObj(audio_session_t sessionId, 148 android::sp<android::AudioEffect>& effect, 149 const effect_uuid_t *type); 150 151extern bool android_fx_initEffectDescriptor(const SLInterfaceID effectId, 152 effect_descriptor_t* fxDescrLoc); 153