Fields Summary |
---|
private static final String | TAG |
public static final int | PARAM_ROOM_LEVELRoom level. Parameter ID for OnParameterChangeListener |
public static final int | PARAM_ROOM_HF_LEVELRoom HF level. Parameter ID for OnParameterChangeListener |
public static final int | PARAM_DECAY_TIMEDecay time. Parameter ID for OnParameterChangeListener |
public static final int | PARAM_DECAY_HF_RATIODecay HF ratio. Parameter ID for
{@link android.media.audiofx.EnvironmentalReverb.OnParameterChangeListener} |
public static final int | PARAM_REFLECTIONS_LEVELEarly reflections level. Parameter ID for OnParameterChangeListener |
public static final int | PARAM_REFLECTIONS_DELAYEarly reflections delay. Parameter ID for OnParameterChangeListener |
public static final int | PARAM_REVERB_LEVELReverb level. Parameter ID for OnParameterChangeListener |
public static final int | PARAM_REVERB_DELAYReverb delay. Parameter ID for OnParameterChangeListener |
public static final int | PARAM_DIFFUSIONDiffusion. Parameter ID for OnParameterChangeListener |
public static final int | PARAM_DENSITYDensity. Parameter ID for OnParameterChangeListener |
private static final int | PARAM_PROPERTIES |
private OnParameterChangeListener | mParamListenerRegistered listener for parameter changes |
private BaseParameterListener | mBaseParamListenerListener used internally to to receive raw parameter change event from AudioEffect super
class |
private final Object | mParamListenerLockLock for access to mParamListener |
private static int | PROPERTY_SIZE |
Methods Summary |
---|
public short | getDecayHFRatio()Gets the ratio of high frequency decay time (at 5 kHz) relative to low frequencies.
byte[] param = new byte[2];
checkStatus(getParameter(PARAM_DECAY_HF_RATIO, param));
return byteArrayToShort(param);
|
public int | getDecayTime()Gets the decay time.
byte[] param = new byte[4];
checkStatus(getParameter(PARAM_DECAY_TIME, param));
return byteArrayToInt(param);
|
public short | getDensity()Gets the density level.
byte[] param = new byte[2];
checkStatus(getParameter(PARAM_DENSITY, param));
return byteArrayToShort(param);
|
public short | getDiffusion()Gets diffusion level.
byte[] param = new byte[2];
checkStatus(getParameter(PARAM_DIFFUSION, param));
return byteArrayToShort(param);
|
public android.media.audiofx.EnvironmentalReverb$Settings | getProperties()Gets the environmental reverb properties. This method is useful when a snapshot of current
reverb settings must be saved by the application.
byte[] param = new byte[PROPERTY_SIZE];
checkStatus(getParameter(PARAM_PROPERTIES, param));
Settings settings = new Settings();
settings.roomLevel = byteArrayToShort(param, 0);
settings.roomHFLevel = byteArrayToShort(param, 2);
settings.decayTime = byteArrayToInt(param, 4);
settings.decayHFRatio = byteArrayToShort(param, 8);
settings.reflectionsLevel = byteArrayToShort(param, 10);
settings.reflectionsDelay = byteArrayToInt(param, 12);
settings.reverbLevel = byteArrayToShort(param, 16);
settings.reverbDelay = byteArrayToInt(param, 18);
settings.diffusion = byteArrayToShort(param, 22);
settings.density = byteArrayToShort(param, 24);
return settings;
|
public int | getReflectionsDelay()Gets the reflections delay.
byte[] param = new byte[4];
checkStatus(getParameter(PARAM_REFLECTIONS_DELAY, param));
return byteArrayToInt(param);
|
public short | getReflectionsLevel()Gets the volume level of the early reflections.
byte[] param = new byte[2];
checkStatus(getParameter(PARAM_REFLECTIONS_LEVEL, param));
return byteArrayToShort(param);
|
public int | getReverbDelay()Gets the reverb delay.
byte[] param = new byte[4];
checkStatus(getParameter(PARAM_REVERB_DELAY, param));
return byteArrayToInt(param);
|
public short | getReverbLevel()Gets the reverb level.
byte[] param = new byte[2];
checkStatus(getParameter(PARAM_REVERB_LEVEL, param));
return byteArrayToShort(param);
|
public short | getRoomHFLevel()Gets the room HF level.
byte[] param = new byte[2];
checkStatus(getParameter(PARAM_ROOM_HF_LEVEL, param));
return byteArrayToShort(param);
|
public short | getRoomLevel()Gets the master volume level of the environmental reverb effect.
byte[] param = new byte[2];
checkStatus(getParameter(PARAM_ROOM_LEVEL, param));
return byteArrayToShort(param);
|
public void | setDecayHFRatio(short decayHFRatio)Sets the ratio of high frequency decay time (at 5 kHz) relative to the decay time at low
frequencies.
byte[] param = shortToByteArray(decayHFRatio);
checkStatus(setParameter(PARAM_DECAY_HF_RATIO, param));
|
public void | setDecayTime(int decayTime)Sets the time taken for the level of reverberation to decay by 60 dB.
byte[] param = intToByteArray(decayTime);
checkStatus(setParameter(PARAM_DECAY_TIME, param));
|
public void | setDensity(short density)Controls the modal density of the late reverberation decay.
The scale should approximately map linearly to the perceived change in reverberation.
A lower density creates a hollow sound that is useful for simulating small reverberation
spaces such as bathrooms.
byte[] param = shortToByteArray(density);
checkStatus(setParameter(PARAM_DENSITY, param));
|
public void | setDiffusion(short diffusion)Sets the echo density in the late reverberation decay.
The scale should approximately map linearly to the perceived change in reverberation.
byte[] param = shortToByteArray(diffusion);
checkStatus(setParameter(PARAM_DIFFUSION, param));
|
public void | setParameterListener(android.media.audiofx.EnvironmentalReverb$OnParameterChangeListener listener)Registers an OnParameterChangeListener interface.
synchronized (mParamListenerLock) {
if (mParamListener == null) {
mParamListener = listener;
mBaseParamListener = new BaseParameterListener();
super.setParameterListener(mBaseParamListener);
}
}
|
public void | setProperties(android.media.audiofx.EnvironmentalReverb$Settings settings)Sets the environmental reverb properties. This method is useful when reverb settings have to
be applied from a previous backup.
byte[] param = concatArrays(shortToByteArray(settings.roomLevel),
shortToByteArray(settings.roomHFLevel),
intToByteArray(settings.decayTime),
shortToByteArray(settings.decayHFRatio),
shortToByteArray(settings.reflectionsLevel),
intToByteArray(settings.reflectionsDelay),
shortToByteArray(settings.reverbLevel),
intToByteArray(settings.reverbDelay),
shortToByteArray(settings.diffusion),
shortToByteArray(settings.density));
checkStatus(setParameter(PARAM_PROPERTIES, param));
|
public void | setReflectionsDelay(int reflectionsDelay)Sets the delay time for the early reflections.
This method sets the time between when the direct path is heard and when the first
reflection is heard.
byte[] param = intToByteArray(reflectionsDelay);
checkStatus(setParameter(PARAM_REFLECTIONS_DELAY, param));
|
public void | setReflectionsLevel(short reflectionsLevel)Sets the volume level of the early reflections.
This level is combined with the overall room level
(set using {@link #setRoomLevel(short)}).
byte[] param = shortToByteArray(reflectionsLevel);
checkStatus(setParameter(PARAM_REFLECTIONS_LEVEL, param));
|
public void | setReverbDelay(int reverbDelay)Sets the time between the first reflection and the reverberation.
byte[] param = intToByteArray(reverbDelay);
checkStatus(setParameter(PARAM_REVERB_DELAY, param));
|
public void | setReverbLevel(short reverbLevel)Sets the volume level of the late reverberation.
This level is combined with the overall room level (set using {@link #setRoomLevel(short)}).
byte[] param = shortToByteArray(reverbLevel);
checkStatus(setParameter(PARAM_REVERB_LEVEL, param));
|
public void | setRoomHFLevel(short roomHF)Sets the volume level at 5 kHz relative to the volume level at low frequencies of the
overall reverb effect.
This controls a low-pass filter that will reduce the level of the high-frequency.
byte[] param = shortToByteArray(roomHF);
checkStatus(setParameter(PARAM_ROOM_HF_LEVEL, param));
|
public void | setRoomLevel(short room)Sets the master volume level of the environmental reverb effect.
byte[] param = shortToByteArray(room);
checkStatus(setParameter(PARAM_ROOM_LEVEL, param));
|