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

# NoiseSuppressor

*** ** * ** ***

` public class NoiseSuppressor `   
` ` ` extends 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.NoiseSuppressor |

<br />

*** ** * ** ***

Noise Suppressor (NS).

Noise suppression (NS) is an audio pre-processor which removes background noise from the captured signal. The component of the signal considered as noise can be either stationary (car/airplane engine, AC system) or non-stationary (other peoples conversations, car horn) for more advanced implementations.

NS is mostly used by voice communication applications (voice chat, video conferencing, SIP calls).

An application creates a NoiseSuppressor object to instantiate and control an NS engine in the audio framework.

To attach the NoiseSuppressor to a particular `https://developer.android.com/reference/android/media/AudioRecord`, specify the audio session ID of this AudioRecord when creating the NoiseSuppressor. The audio session is retrieved by calling `https://developer.android.com/reference/android/media/AudioRecord#getAudioSessionId()` on the AudioRecord instance.

On some devices, NS can be inserted by default in the capture path by the platform according to the `https://developer.android.com/reference/android/media/MediaRecorder.AudioSource` used. The application should call NoiseSuppressor.getEnable() after creating the NS to check the default NS activation state on a particular AudioRecord session.

See `https://developer.android.com/reference/android/media/audiofx/AudioEffect` class for more details on controlling audio effects.

## Summary

### Inherited constants

From class `https://developer.android.com/reference/android/media/audiofx/AudioEffect` `https://developer.android.com/reference/java/lang/String` `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.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL`

Intent to launch an audio effect control panel UI.
`https://developer.android.com/reference/java/lang/String` `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` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#ALREADY_EXISTS`

Internal operation status.
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#CONTENT_TYPE_GAME`

Value for `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE` when the type of content played is game audio
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#CONTENT_TYPE_MOVIE`

Value for `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE` when the type of content played is video or movie
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#CONTENT_TYPE_MUSIC`

Value for `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE` when the type of content played is music
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#CONTENT_TYPE_VOICE`

Value for `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE` when the type of content played is voice audio
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_AUXILIARY`

Effect connection mode is auxiliary.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_INSERT`

Effect connection mode is insert.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_POST_PROCESSING`

Effect connection mode is post processing.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_PRE_PROCESSING`

Effect connection mode is pre processing.
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR`

Unspecified error.
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_BAD_VALUE`

Operation failed due to bad parameter value.
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_DEAD_OBJECT`

Operation failed due to dead remote object.
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_INVALID_OPERATION`

Operation failed because it was requested in wrong state.
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_NO_INIT`

Operation failed due to bad object initialization.
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#ERROR_NO_MEMORY`

Operation failed due to lack of memory.
`https://developer.android.com/reference/java/lang/String` `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.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_CONTENT_TYPE`

Indicates which type of content is played by the application.
`https://developer.android.com/reference/java/lang/String` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EXTRA_PACKAGE_NAME`

Contains the package name of the calling application.
`int` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#SUCCESS`

Successful operation.

### Inherited fields

From class `https://developer.android.com/reference/android/media/audiofx/AudioEffect` ` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_AEC`

UUID for Acoustic Echo Canceler (AEC)
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_AGC`

UUID for Automatic Gain Control (AGC)
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_BASS_BOOST`

UUID for bass boost effect
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_DYNAMICS_PROCESSING`

UUID for Dynamics Processing
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_ENV_REVERB`

UUID for environmental reverberation effect
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_EQUALIZER`

UUID for equalizer effect
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_HAPTIC_GENERATOR`

UUID for Haptic Generator.
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_LOUDNESS_ENHANCER`

UUID for Loudness Enhancer
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_NS`

UUID for Noise Suppressor (NS)
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_PRESET_REVERB`

UUID for preset reverberation effect
` public static final https://developer.android.com/reference/java/util/UUID` `https://developer.android.com/reference/android/media/audiofx/AudioEffect#EFFECT_TYPE_VIRTUALIZER`

UUID for virtualizer effect

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/android/media/audiofx/NoiseSuppressor` | ` https://developer.android.com/reference/android/media/audiofx/NoiseSuppressor#create(int)(int audioSession) ` Creates a NoiseSuppressor and attaches it to the AudioRecord on the audio session specified. |
| ` static boolean` | ` https://developer.android.com/reference/android/media/audiofx/NoiseSuppressor#isAvailable()() ` Checks if the device implements noise suppression. |

### Inherited methods

From class ` https://developer.android.com/reference/android/media/audiofx/AudioEffect ` ` void` ` 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.
` https://developer.android.com/reference/android/media/audiofx/AudioEffect.Descriptor` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#getDescriptor()() `

Get the effect descriptor.
` boolean` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#getEnabled()() `

Returns effect enabled state
` int` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#getId()() `

Returns effect unique identifier.
` boolean` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#hasControl()() `

Checks if this AudioEffect object is controlling the effect engine.
` static https://developer.android.com/reference/android/media/audiofx/AudioEffect.Descriptor` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#queryEffects()() `

Query all effects available on the platform.
` void` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#release()() `

Releases the native AudioEffect resources.
` void` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#setControlStatusListener(android.media.audiofx.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` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#setEnableStatusListener(android.media.audiofx.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` ` https://developer.android.com/reference/android/media/audiofx/AudioEffect#setEnabled(boolean)(boolean enabled) `

Enable or disable the effect.
From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` 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 https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` 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` ` 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` ` 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*.

## Public methods

### create

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

```
public static NoiseSuppressor create (int audioSession)
```

Creates a NoiseSuppressor and attaches it to the AudioRecord on the audio session specified.

<br />

| Parameters ||
|---|---|
| `audioSession` | `int`: system wide unique audio session identifier. The NoiseSuppressor will be applied to the AudioRecord with the same audio session. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/media/audiofx/NoiseSuppressor` | NoiseSuppressor created or null if the device does not implement noise suppression. <br /> |

### isAvailable

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

```
public static boolean isAvailable ()
```

Checks if the device implements noise suppression.

<br />

| Returns ||
|---|---|
| `boolean` | true if the device implements noise suppression, false otherwise. <br /> |