LoudnessEnhancerpublic class LoudnessEnhancer extends android.media.audiofx.AudioEffect LoudnessEnhancer is an audio effect for increasing audio loudness.
The processing is parametrized by a target gain value, which determines the maximum amount
by which an audio signal will be amplified; signals amplified outside of the sample
range supported by the platform are compressed.
An application creates a LoudnessEnhancer object to instantiate and control a
this audio effect in the audio framework.
To attach the LoudnessEnhancer to a particular AudioTrack or MediaPlayer,
specify the audio session ID of this AudioTrack or MediaPlayer when constructing the effect
(see {@link AudioTrack#getAudioSessionId()} and {@link MediaPlayer#getAudioSessionId()}). |
Fields Summary |
---|
private static final String | TAG | public static final int | PARAM_TARGET_GAIN_MBThe maximum gain applied applied to the signal to process.
It is expressed in millibels (100mB = 1dB) where 0mB corresponds to no amplification. | private OnParameterChangeListener | mParamListenerRegistered listener for parameter changes. | private BaseParameterListener | mBaseParamListenerListener used internally to to receive raw parameter change events
from AudioEffect super class | private final Object | mParamListenerLockLock for access to mParamListener |
Constructors Summary |
---|
public LoudnessEnhancer(int audioSession)Class constructor.
super(EFFECT_TYPE_LOUDNESS_ENHANCER, EFFECT_TYPE_NULL, 0, audioSession);
if (audioSession == 0) {
Log.w(TAG, "WARNING: attaching a LoudnessEnhancer to global output mix is deprecated!");
}
| public LoudnessEnhancer(int priority, int audioSession)
super(EFFECT_TYPE_LOUDNESS_ENHANCER, EFFECT_TYPE_NULL, priority, audioSession);
if (audioSession == 0) {
Log.w(TAG, "WARNING: attaching a LoudnessEnhancer to global output mix is deprecated!");
}
|
Methods Summary |
---|
public android.media.audiofx.LoudnessEnhancer$Settings | getProperties()
Settings settings = new Settings();
int[] value = new int[1];
checkStatus(getParameter(PARAM_TARGET_GAIN_MB, value));
settings.targetGainmB = value[0];
return settings;
| public float | getTargetGain()Return the target gain.
int[] value = new int[1];
checkStatus(getParameter(PARAM_TARGET_GAIN_MB, value));
return value[0];
| public void | setParameterListener(android.media.audiofx.LoudnessEnhancer$OnParameterChangeListener listener)
synchronized (mParamListenerLock) {
if (mParamListener == null) {
mBaseParamListener = new BaseParameterListener();
super.setParameterListener(mBaseParamListener);
}
mParamListener = listener;
}
| public void | setProperties(android.media.audiofx.LoudnessEnhancer$Settings settings)
checkStatus(setParameter(PARAM_TARGET_GAIN_MB, settings.targetGainmB));
| public void | setTargetGain(int gainmB)Set the target gain for the audio effect.
The target gain is the maximum value by which a sample value will be amplified when the
effect is enabled.
checkStatus(setParameter(PARAM_TARGET_GAIN_MB, gainmB));
|
|