public class LoudnessEnhancer extends AudioEffect
AudioTrack.getAudioSessionId()
and MediaPlayer.getAudioSessionId()
).Modifier and Type | Class and Description |
---|---|
static interface |
LoudnessEnhancer.OnParameterChangeListener |
static class |
LoudnessEnhancer.Settings |
AudioEffect.Descriptor, AudioEffect.OnControlStatusChangeListener, AudioEffect.OnEnableStatusChangeListener
Modifier and Type | Field and Description |
---|---|
static int |
PARAM_TARGET_GAIN_MB
The maximum gain applied applied to the signal to process.
|
ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION, ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL, ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION, ALREADY_EXISTS, CONTENT_TYPE_GAME, CONTENT_TYPE_MOVIE, CONTENT_TYPE_MUSIC, CONTENT_TYPE_VOICE, EFFECT_AUXILIARY, EFFECT_INSERT, EFFECT_PRE_PROCESSING, EFFECT_TYPE_AEC, EFFECT_TYPE_AGC, EFFECT_TYPE_BASS_BOOST, EFFECT_TYPE_ENV_REVERB, EFFECT_TYPE_EQUALIZER, EFFECT_TYPE_LOUDNESS_ENHANCER, EFFECT_TYPE_NS, EFFECT_TYPE_NULL, EFFECT_TYPE_PRESET_REVERB, EFFECT_TYPE_VIRTUALIZER, ERROR, ERROR_BAD_VALUE, ERROR_DEAD_OBJECT, ERROR_INVALID_OPERATION, ERROR_NO_INIT, ERROR_NO_MEMORY, EXTRA_AUDIO_SESSION, EXTRA_CONTENT_TYPE, EXTRA_PACKAGE_NAME, mListenerLock, mNativeEventHandler, NATIVE_EVENT_CONTROL_STATUS, NATIVE_EVENT_ENABLED_STATUS, NATIVE_EVENT_PARAMETER_CHANGED, STATE_INITIALIZED, STATE_UNINITIALIZED, SUCCESS
Constructor and Description |
---|
LoudnessEnhancer(int audioSession)
Class constructor.
|
LoudnessEnhancer(int priority,
int audioSession) |
Modifier and Type | Method and Description |
---|---|
LoudnessEnhancer.Settings |
getProperties() |
float |
getTargetGain()
Return the target gain.
|
void |
setParameterListener(LoudnessEnhancer.OnParameterChangeListener listener) |
void |
setProperties(LoudnessEnhancer.Settings settings) |
void |
setTargetGain(int gainmB)
Set the target gain for the audio effect.
|
byteArrayToInt, byteArrayToInt, byteArrayToShort, byteArrayToShort, checkState, checkStatus, command, concatArrays, finalize, getDescriptor, getEnabled, getId, getParameter, getParameter, getParameter, getParameter, getParameter, getParameter, getParameter, hasControl, intToByteArray, isEffectTypeAvailable, isError, queryEffects, queryPreProcessings, release, setControlStatusListener, setEnabled, setEnableStatusListener, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameterListener, shortToByteArray
public static final int PARAM_TARGET_GAIN_MB
public LoudnessEnhancer(int audioSession) throws IllegalStateException, IllegalArgumentException, UnsupportedOperationException, RuntimeException
audioSession
- system-wide unique audio session identifier. The LoudnessEnhancer
will be attached to the MediaPlayer or AudioTrack in the same audio session.IllegalStateException
IllegalArgumentException
UnsupportedOperationException
RuntimeException
public LoudnessEnhancer(int priority, int audioSession) throws IllegalStateException, IllegalArgumentException, UnsupportedOperationException, RuntimeException
priority
- the priority level requested by the application for controlling the
LoudnessEnhancer engine. As the same engine can be shared by several applications,
this parameter indicates how much the requesting application needs control of effect
parameters. The normal priority is 0, above normal is a positive number, below normal a
negative number.audioSession
- system-wide unique audio session identifier. The LoudnessEnhancer
will be attached to the MediaPlayer or AudioTrack in the same audio session.IllegalStateException
IllegalArgumentException
UnsupportedOperationException
RuntimeException
public void setTargetGain(int gainmB) throws IllegalStateException, IllegalArgumentException, UnsupportedOperationException
gainmB
- the effect target gain expressed in mB. 0mB corresponds to no amplification.IllegalStateException
IllegalArgumentException
UnsupportedOperationException
public float getTargetGain() throws IllegalStateException, IllegalArgumentException, UnsupportedOperationException
IllegalStateException
IllegalArgumentException
UnsupportedOperationException
public void setParameterListener(LoudnessEnhancer.OnParameterChangeListener listener)
listener
- OnParameterChangeListener interface registeredpublic LoudnessEnhancer.Settings getProperties() throws IllegalStateException, IllegalArgumentException, UnsupportedOperationException
IllegalStateException
IllegalArgumentException
UnsupportedOperationException
public void setProperties(LoudnessEnhancer.Settings settings) throws IllegalStateException, IllegalArgumentException, UnsupportedOperationException
settings
- a LoudnessEnhancer.Settings object containing the properties to applyIllegalStateException
IllegalArgumentException
UnsupportedOperationException