196309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent/*
296309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * Copyright (C) 2011 The Android Open Source Project
396309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent *
496309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * Licensed under the Apache License, Version 2.0 (the "License");
596309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * you may not use this file except in compliance with the License.
696309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * You may obtain a copy of the License at
796309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent *
896309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent *      http://www.apache.org/licenses/LICENSE-2.0
996309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent *
1096309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * Unless required by applicable law or agreed to in writing, software
1196309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * distributed under the License is distributed on an "AS IS" BASIS,
1296309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1396309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * See the License for the specific language governing permissions and
1496309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent * limitations under the License.
1596309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent */
1696309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
1796309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#ifndef ANDROID_EFFECT_ENVIRONMENTALREVERB_H_
1896309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#define ANDROID_EFFECT_ENVIRONMENTALREVERB_H_
1996309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
2096309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#include <hardware/audio_effect.h>
2196309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
2296309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#if __cplusplus
2396309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurentextern "C" {
2496309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#endif
2596309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
2696309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#ifndef OPENSL_ES_H_
2796309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurentstatic const effect_uuid_t SL_IID_ENVIRONMENTALREVERB_ = { 0xc2e5d5f0, 0x94bd, 0x4763, 0x9cac, { 0x4e, 0x23, 0x4d, 0x6, 0x83, 0x9e } };
2896309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurentconst effect_uuid_t * const SL_IID_ENVIRONMENTALREVERB = &SL_IID_ENVIRONMENTALREVERB_;
2996309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#endif //OPENSL_ES_H_
3096309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
3196309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent/* enumerated parameter settings for environmental reverb effect */
3296309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurenttypedef enum
3396309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent{
3496309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    // Parameters below are as defined in OpenSL ES specification for environmental reverb interface
3596309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_ROOM_LEVEL,            // in millibels,    range -6000 to 0
3696309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_ROOM_HF_LEVEL,         // in millibels,    range -4000 to 0
3796309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_DECAY_TIME,            // in milliseconds, range 100 to 20000
3896309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_DECAY_HF_RATIO,        // in permilles,    range 100 to 1000
3996309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_REFLECTIONS_LEVEL,     // in millibels,    range -6000 to 0
4096309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_REFLECTIONS_DELAY,     // in milliseconds, range 0 to 65
4196309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_REVERB_LEVEL,          // in millibels,    range -6000 to 0
4296309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_REVERB_DELAY,          // in milliseconds, range 0 to 65
4396309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_DIFFUSION,             // in permilles,    range 0 to 1000
4496309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_DENSITY,               // in permilles,    range 0 to 1000
4596309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_PROPERTIES,
4696309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    REVERB_PARAM_BYPASS
4796309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent} t_env_reverb_params;
4896309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
4996309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent//t_reverb_settings is equal to SLEnvironmentalReverbSettings defined in OpenSL ES specification.
5096309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurenttypedef struct s_reverb_settings {
5196309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    int16_t     roomLevel;
5296309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    int16_t     roomHFLevel;
5396309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    uint32_t    decayTime;
5496309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    int16_t     decayHFRatio;
5596309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    int16_t     reflectionsLevel;
5696309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    uint32_t    reflectionsDelay;
5796309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    int16_t     reverbLevel;
5896309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    uint32_t    reverbDelay;
5996309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    int16_t     diffusion;
6096309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent    int16_t     density;
6196309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent} __attribute__((packed)) t_reverb_settings;
6296309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
6396309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
6496309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#if __cplusplus
6596309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent}  // extern "C"
6696309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#endif
6796309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
6896309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent
6996309256bf532b3ce5ad706d7eb60b1dd70bf4b3Eric Laurent#endif /*ANDROID_EFFECT_ENVIRONMENTALREVERB_H_*/
70