# LoudnessEnhancer

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#constants)\|[Inherited Constants](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#inhconstants)\|[Inherited Fields](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#inhfields)\|[Ctors](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#pubctors)\|[Methods](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#inhmethods)  

# LoudnessEnhancer

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/media/audiofx/LoudnessEnhancer "View this page in Kotlin")\|Java

`
public


class
LoudnessEnhancer
`  
`


``

extends `[AudioEffect](https://developer.android.com/reference/android/media/audiofx/AudioEffect)`


``


`

|---|---|----------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.media.audiofx.AudioEffect](https://developer.android.com/reference/android/media/audiofx/AudioEffect) ||
|   | ↳ | android.media.audiofx.LoudnessEnhancer |

<br />

*** ** * ** ***

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[AudioTrack.getAudioSessionId()](https://developer.android.com/reference/android/media/AudioTrack#getAudioSessionId())and[MediaPlayer.getAudioSessionId()](https://developer.android.com/reference/android/media/MediaPlayer#getAudioSessionId())).

## Summary

|                                                                                     ### Constants                                                                                     ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [PARAM_TARGET_GAIN_MB](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#PARAM_TARGET_GAIN_MB) The maximum gain applied to the signal to process. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[android.media.audiofx.AudioEffect](https://developer.android.com/reference/android/media/audiofx/AudioEffect) |--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://developer.android.com/reference/java/lang/String) | [ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION) Intent to signal to the effect control application or service that an audio session is closed and that effects should not be applied anymore. | | [String](https://developer.android.com/reference/java/lang/String) | [ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL) Intent to launch an audio effect control panel UI.                                                                                            | | [String](https://developer.android.com/reference/java/lang/String) | [ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION) Intent to signal to the effect control application or service that a new audio session is opened and requires audio effects to be applied.      | | `int`                                                              | [ALREADY_EXISTS](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ALREADY_EXISTS) Internal operation status.                                                                                                                                                                          | | `int`                                                              | [CONTENT_TYPE_GAME](https://developer.android.com/reference/android/media/audiofx/AudioEffect#CONTENT_TYPE_GAME) Value for[EXTRA_CONTENT_TYPE](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE)when the type of content played is game audio                      | | `int`                                                              | [CONTENT_TYPE_MOVIE](https://developer.android.com/reference/android/media/audiofx/AudioEffect#CONTENT_TYPE_MOVIE) Value for[EXTRA_CONTENT_TYPE](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE)when the type of content played is video or movie                | | `int`                                                              | [CONTENT_TYPE_MUSIC](https://developer.android.com/reference/android/media/audiofx/AudioEffect#CONTENT_TYPE_MUSIC) Value for[EXTRA_CONTENT_TYPE](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE)when the type of content played is music                         | | `int`                                                              | [CONTENT_TYPE_VOICE](https://developer.android.com/reference/android/media/audiofx/AudioEffect#CONTENT_TYPE_VOICE) Value for[EXTRA_CONTENT_TYPE](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE)when the type of content played is voice audio                   | | [String](https://developer.android.com/reference/java/lang/String) | [EFFECT_AUXILIARY](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_AUXILIARY) Effect connection mode is auxiliary.                                                                                                                                                            | | [String](https://developer.android.com/reference/java/lang/String) | [EFFECT_INSERT](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_INSERT) Effect connection mode is insert.                                                                                                                                                                     | | [String](https://developer.android.com/reference/java/lang/String) | [EFFECT_POST_PROCESSING](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_POST_PROCESSING) Effect connection mode is post processing.                                                                                                                                          | | [String](https://developer.android.com/reference/java/lang/String) | [EFFECT_PRE_PROCESSING](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_PRE_PROCESSING) Effect connection mode is pre processing.                                                                                                                                             | | `int`                                                              | [ERROR](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR) Unspecified error.                                                                                                                                                                                                    | | `int`                                                              | [ERROR_BAD_VALUE](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_BAD_VALUE) Operation failed due to bad parameter value.                                                                                                                                                      | | `int`                                                              | [ERROR_DEAD_OBJECT](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_DEAD_OBJECT) Operation failed due to dead remote object.                                                                                                                                                   | | `int`                                                              | [ERROR_INVALID_OPERATION](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_INVALID_OPERATION) Operation failed because it was requested in wrong state.                                                                                                                         | | `int`                                                              | [ERROR_NO_INIT](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_NO_INIT) Operation failed due to bad object initialization.                                                                                                                                                    | | `int`                                                              | [ERROR_NO_MEMORY](https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_NO_MEMORY) Operation failed due to lack of memory.                                                                                                                                                           | | [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_AUDIO_SESSION](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_AUDIO_SESSION) Contains the ID of the audio session the effects should be applied to.                                                                                                                    | | [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_CONTENT_TYPE](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE) Indicates which type of content is played by the application.                                                                                                                               | | [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_PACKAGE_NAME](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_PACKAGE_NAME) Contains the package name of the calling application.                                                                                                                                       | | `int`                                                              | [SUCCESS](https://developer.android.com/reference/android/media/audiofx/AudioEffect#SUCCESS) Successful operation.                                                                                                                                                                                             | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Inherited fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[android.media.audiofx.AudioEffect](https://developer.android.com/reference/android/media/audiofx/AudioEffect) |---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_AEC](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_AEC) UUID for Acoustic Echo Canceler (AEC)                        | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_AGC](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_AGC) UUID for Automatic Gain Control (AGC)                        | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_BASS_BOOST](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_BASS_BOOST) UUID for bass boost effect                     | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_DYNAMICS_PROCESSING](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_DYNAMICS_PROCESSING) UUID for Dynamics Processing | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_ENV_REVERB](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_ENV_REVERB) UUID for environmental reverberation effect    | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_EQUALIZER](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_EQUALIZER) UUID for equalizer effect                        | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_HAPTIC_GENERATOR](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_HAPTIC_GENERATOR) UUID for Haptic Generator.         | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_LOUDNESS_ENHANCER](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_LOUDNESS_ENHANCER) UUID for Loudness Enhancer       | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_NS](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_NS) UUID for Noise Suppressor (NS)                                 | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_PRESET_REVERB](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_PRESET_REVERB) UUID for preset reverberation effect     | | ` public static final `[UUID](https://developer.android.com/reference/java/util/UUID) | [EFFECT_TYPE_VIRTUALIZER](https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_VIRTUALIZER) UUID for virtualizer effect                  | |

|                                                                        ### Public constructors                                                                         ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[LoudnessEnhancer](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#LoudnessEnhancer(int))`(int audioSession) ` Class constructor. |

|                                                                                    ### Public methods                                                                                    ||
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` float` | ` `[getTargetGain](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#getTargetGain())`() ` Return the target gain.                                |
| ` void`  | ` `[setTargetGain](https://developer.android.com/reference/android/media/audiofx/LoudnessEnhancer#setTargetGain(int))`(int gainmB) ` Set the target gain for the audio effect. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.media.audiofx.AudioEffect](https://developer.android.com/reference/android/media/audiofx/AudioEffect)` ` |-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                                                           | ` `[finalize](https://developer.android.com/reference/android/media/audiofx/AudioEffect#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                                                                                                                                                                                          | | ` `[AudioEffect.Descriptor](https://developer.android.com/reference/android/media/audiofx/AudioEffect.Descriptor) | ` `[getDescriptor](https://developer.android.com/reference/android/media/audiofx/AudioEffect#getDescriptor())`() ` Get the effect descriptor.                                                                                                                                                                                                                                                                                                                      | | ` boolean`                                                                                                        | ` `[getEnabled](https://developer.android.com/reference/android/media/audiofx/AudioEffect#getEnabled())`() ` Returns effect enabled state                                                                                                                                                                                                                                                                                                                          | | ` int`                                                                                                            | ` `[getId](https://developer.android.com/reference/android/media/audiofx/AudioEffect#getId())`() ` Returns effect unique identifier.                                                                                                                                                                                                                                                                                                                               | | ` boolean`                                                                                                        | ` `[hasControl](https://developer.android.com/reference/android/media/audiofx/AudioEffect#hasControl())`() ` Checks if this AudioEffect object is controlling the effect engine.                                                                                                                                                                                                                                                                                   | | ` static `[Descriptor[]](https://developer.android.com/reference/android/media/audiofx/AudioEffect.Descriptor)    | ` `[queryEffects](https://developer.android.com/reference/android/media/audiofx/AudioEffect#queryEffects())`() ` Query all effects available on the platform.                                                                                                                                                                                                                                                                                                      | | ` void`                                                                                                           | ` `[release](https://developer.android.com/reference/android/media/audiofx/AudioEffect#release())`() ` Releases the native AudioEffect resources.                                                                                                                                                                                                                                                                                                                  | | ` void`                                                                                                           | ` `[setControlStatusListener](https://developer.android.com/reference/android/media/audiofx/AudioEffect#setControlStatusListener(android.media.audiofx.AudioEffect.OnControlStatusChangeListener))`(`[AudioEffect.OnControlStatusChangeListener](https://developer.android.com/reference/android/media/audiofx/AudioEffect.OnControlStatusChangeListener)` listener) ` Sets the listener AudioEffect notifies when the effect engine control is taken or returned. | | ` void`                                                                                                           | ` `[setEnableStatusListener](https://developer.android.com/reference/android/media/audiofx/AudioEffect#setEnableStatusListener(android.media.audiofx.AudioEffect.OnEnableStatusChangeListener))`(`[AudioEffect.OnEnableStatusChangeListener](https://developer.android.com/reference/android/media/audiofx/AudioEffect.OnEnableStatusChangeListener)` listener) ` Sets the listener AudioEffect notifies when the effect engine is enabled or disabled.            | | ` int`                                                                                                            | ` `[setEnabled](https://developer.android.com/reference/android/media/audiofx/AudioEffect#setEnabled(boolean))`(boolean enabled) ` Enable or disable the effect.                                                                                                                                                                                                                                                                                                   | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### PARAM_TARGET_GAIN_MB

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int PARAM_TARGET_GAIN_MB
```

The maximum gain applied to the signal to process. It is expressed in millibels (100mB = 1dB) where 0mB corresponds to no amplification.

<br />

Constant Value: 0 (0x00000000)

## Public constructors

### LoudnessEnhancer

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public LoudnessEnhancer (int audioSession)
```

Class constructor.

<br />

|                                                                                  Parameters                                                                                  ||
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `audioSession` | `int`: system-wide unique audio session identifier. The LoudnessEnhancer will be attached to the MediaPlayer or AudioTrack in the same audio session. <br /> |

|                                                                          Throws                                                                           ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
|                                                                                                                  | java.lang.IllegalStateException         |
|                                                                                                                  | java.lang.IllegalArgumentException      |
|                                                                                                                  | java.lang.UnsupportedOperationException |
|                                                                                                                  | java.lang.RuntimeException              |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)           |                                         |
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)                 |                                         |
| [RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException)                           |                                         |
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) |                                         |

## Public methods

### getTargetGain

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getTargetGain ()
```

Return the target gain.

<br />

|                         Returns                         ||
|---------|------------------------------------------------|
| `float` | the effect target gain expressed in mB. <br /> |

|                                                                          Throws                                                                           ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
|                                                                                                                  | java.lang.IllegalStateException         |
|                                                                                                                  | java.lang.IllegalArgumentException      |
|                                                                                                                  | java.lang.UnsupportedOperationException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)           |                                         |
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)                 |                                         |
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) |                                         |

### setTargetGain

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
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.

<br />

|                                              Parameters                                              ||
|----------|--------------------------------------------------------------------------------------------|
| `gainmB` | `int`: the effect target gain expressed in mB. 0mB corresponds to no amplification. <br /> |

|                                                                          Throws                                                                           ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
|                                                                                                                  | java.lang.IllegalStateException         |
|                                                                                                                  | java.lang.IllegalArgumentException      |
|                                                                                                                  | java.lang.UnsupportedOperationException |
| [IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException)           |                                         |
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)                 |                                         |
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) |                                         |