Skip to content

Most visited

Recently visited

navigation

LoudnessEnhancer

public class LoudnessEnhancer
extends AudioEffect

java.lang.Object
   ↳ android.media.audiofx.AudioEffect
     ↳ android.media.audiofx.LoudnessEnhancer


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 getAudioSessionId() and getAudioSessionId()).

Summary

Constants

int PARAM_TARGET_GAIN_MB

The maximum gain applied applied to the signal to process.

Inherited constants

From class android.media.audiofx.AudioEffect

Inherited fields

From class android.media.audiofx.AudioEffect

Public constructors

LoudnessEnhancer(int audioSession)

Class constructor.

Public methods

float getTargetGain()

Return the target gain.

void setTargetGain(int gainmB)

Set the target gain for the audio effect.

Inherited methods

From class android.media.audiofx.AudioEffect
From class java.lang.Object

Constants

PARAM_TARGET_GAIN_MB

Added in API level 19
int PARAM_TARGET_GAIN_MB

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

Constant Value: 0 (0x00000000)

Public constructors

LoudnessEnhancer

Added in API level 19
LoudnessEnhancer (int audioSession)

Class constructor.

Parameters
audioSession int: system-wide unique audio session identifier. The LoudnessEnhancer will be attached to the MediaPlayer or AudioTrack in the same audio session.
Throws
java.lang.IllegalStateException
java.lang.IllegalArgumentException
java.lang.UnsupportedOperationException
RuntimeException
IllegalStateException
IllegalArgumentException
UnsupportedOperationException

Public methods

getTargetGain

Added in API level 19
float getTargetGain ()

Return the target gain.

Returns
float the effect target gain expressed in mB.
Throws
IllegalStateException
IllegalArgumentException
UnsupportedOperationException
IllegalStateException
IllegalArgumentException

setTargetGain

Added in API level 19
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.

Parameters
gainmB int: the effect target gain expressed in mB. 0mB corresponds to no amplification.
Throws
IllegalStateException
IllegalArgumentException
UnsupportedOperationException
IllegalStateException
IllegalArgumentException
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.