# DynamicsProcessing.Limiter

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

# Limiter

*** ** * ** ***

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

```
class Limiter : DynamicsProcessing.Stage
```

|---|---|------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                          |||
| ↳ | [android.media.audiofx.DynamicsProcessing.Stage](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Stage)         ||
|   | ↳ | [android.media.audiofx.DynamicsProcessing.Limiter](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#) |

Class for Limiter Stage Limiter is a single band compressor at the end of the processing chain, commonly used to protect the signal from overloading and distortion. Limiters have multiple controllable parameters: enabled/disabled, linkGroup, attackTime, releaseTime, ratio, threshold, and postGain.

Limiters can be linked in groups across multiple channels. Linked limiters will trigger the same limiting if any of the linked limiters starts compressing.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Limiter](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#Limiter(android.media.audiofx.DynamicsProcessing.Limiter))`(`cfg:` `[DynamicsProcessing.Limiter](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#)!`)` Class Constructor for Limiter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Limiter](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#Limiter(kotlin.Boolean,%20kotlin.Boolean,%20kotlin.Int,%20kotlin.Float,%20kotlin.Float,%20kotlin.Float,%20kotlin.Float,%20kotlin.Float))`(`inUse:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `enabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `linkGroup:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `attackTime:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `releaseTime:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `ratio:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `threshold:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `postGain:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Class constructor for Limiter Stage |

|                                                                                                                                                                                                       Public methods                                                                                                                                                                                                       ||
|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)   | [getAttackTime](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#getAttackTime())`()` gets attack time for limiter compressor in milliseconds (ms)                                                                                                                                        |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)       | [getLinkGroup](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#getLinkGroup())`()` Gets the linkGroup index for this Limiter Stage.                                                                                                                                                      |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)   | [getPostGain](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#getPostGain())`()` gets the gain applied to the signal AFTER limiting.                                                                                                                                                     |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)   | [getRatio](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#getRatio())`()` gets the limiter compressor ratio (N:1)                                                                                                                                                                       |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)   | [getReleaseTime](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#getReleaseTime())`()` gets release time for limiter compressor in milliseconds (ms)                                                                                                                                     |
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)   | [getThreshold](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#getThreshold())`()` gets the limiter compressor threshold measured in decibels (dB) from 0 dB Full Scale (dBFS).                                                                                                          |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [setAttackTime](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#setAttackTime(kotlin.Float))`(`attackTime:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` sets attack time for limiter compressor in milliseconds (ms)                              |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [setLinkGroup](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#setLinkGroup(kotlin.Int))`(`linkGroup:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the linkGroup index for this limiter Stage.                                                   |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [setPostGain](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#setPostGain(kotlin.Float))`(`postGain:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` sets the gain to be applied to the siganl AFTER the limiter.                                    |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [setRatio](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#setRatio(kotlin.Float))`(`ratio:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` sets limiter compressor ratio (N:1)                                                                      |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [setReleaseTime](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#setReleaseTime(kotlin.Float))`(`releaseTime:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` sets release time for limiter compressor in milliseconds (ms)                          |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [setThreshold](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#setThreshold(kotlin.Float))`(`threshold:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` sets the limiter compressor threshold measured in decibels (dB) from 0 dB Full Scale (dBFS). |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#toString())`()` <br />                                                                                                                                                                                                        |

| Inherited functions ||
|---|---|
| From class[Stage](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Stage) |------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isEnabled](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Stage#isEnabled())`()` <br /> returns enabled state of the stage <br />                                                                                                             | | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isInUse](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Stage#isInUse())`()` <br /> returns inUse state of the stage. <br />                                                                                                                  | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)       | [setEnabled](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Stage#setEnabled(kotlin.Boolean))`(`enabled:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` <br /> sets enabled state of the stage <br /> | ||

## Public constructors

### Limiter

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

```
Limiter(cfg: DynamicsProcessing.Limiter!)
```

Class Constructor for Limiter

|                                                                       Parameters                                                                        ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| `cfg` | [DynamicsProcessing.Limiter](https://developer.android.com/reference/kotlin/android/media/audiofx/DynamicsProcessing.Limiter#)!:copy constructor |

### Limiter

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

```
Limiter(
    inUse: Boolean, 
    enabled: Boolean, 
    linkGroup: Int, 
    attackTime: Float, 
    releaseTime: Float, 
    ratio: Float, 
    threshold: Float, 
    postGain: Float)
```

Class constructor for Limiter Stage

|                                                                                                Parameters                                                                                                 ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `inUse`       | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html):true if MBC stage will be used, false otherwise.                                                        |
| `enabled`     | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html):true if MBC stage is enabled/disabled. This can be changed while effect is running                      |
| `linkGroup`   | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):index of group assigned to this Limiter. Only limiters that share the same linkGroup index will react together. |
| `attackTime`  | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):Attack Time for limiter compressor in milliseconds (ms)                                                     |
| `releaseTime` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):Release Time for limiter compressor in milliseconds (ms)                                                    |
| `ratio`       | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):Limiter Compressor ratio (N:1) (input:output)                                                               |
| `threshold`   | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):Limiter Compressor threshold measured in decibels (dB) from 0 dB Full Scale (dBFS).                         |
| `postGain`    | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):Gain applied to the signal AFTER compression.                                                               |

## Public methods

### getAttackTime

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

```
fun getAttackTime(): Float
```

gets attack time for limiter compressor in milliseconds (ms)

|                                                                 Return                                                                  ||
|--------------------------------------------------------------------------------|---------------------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | attack time for limiter compressor in milliseconds (ms) |

### getLinkGroup

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

```
fun getLinkGroup(): Int
```

Gets the linkGroup index for this Limiter Stage. Only limiters that share the same linkGroup index will react together.

|                                            Return                                            ||
|----------------------------------------------------------------------------|------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | linkGroup index. |

### getPostGain

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

```
fun getPostGain(): Float
```

gets the gain applied to the signal AFTER limiting. Measured in decibels (dB) where 0 dB means no level change

|                                                     Return                                                      ||
|--------------------------------------------------------------------------------|---------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | postGain value in decibels (dB) |

### getRatio

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

```
fun getRatio(): Float
```

gets the limiter compressor ratio (N:1)

|                                                     Return                                                     ||
|--------------------------------------------------------------------------------|--------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | limiter compressor ratio (N:1) |

### getReleaseTime

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

```
fun getReleaseTime(): Float
```

gets release time for limiter compressor in milliseconds (ms)

|                                                                  Return                                                                  ||
|--------------------------------------------------------------------------------|----------------------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | release time for limiter compressor in milliseconds (ms) |

### getThreshold

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

```
fun getThreshold(): Float
```

gets the limiter compressor threshold measured in decibels (dB) from 0 dB Full Scale (dBFS). Thresholds are negative. A threshold of 0 dB means no limiting will take place.

|                                                            Return                                                             ||
|--------------------------------------------------------------------------------|-----------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | limiter compressor threshold in decibels (dB) |

### setAttackTime

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

```
fun setAttackTime(attackTime: Float): Unit
```

sets attack time for limiter compressor in milliseconds (ms)

|                                                                    Parameters                                                                    ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------|
| `attackTime` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):desired for limiter compressor in milliseconds (ms) |

### setLinkGroup

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

```
fun setLinkGroup(linkGroup: Int): Unit
```

Sets the linkGroup index for this limiter Stage.

|                                                   Parameters                                                    ||
|-------------|----------------------------------------------------------------------------------------------------|
| `linkGroup` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):desired linkGroup index |

### setPostGain

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

```
fun setPostGain(postGain: Float): Unit
```

sets the gain to be applied to the siganl AFTER the limiter. Measured in decibels (dB), where 0 dB means no level change.

|                                                        Parameters                                                         ||
|------------|---------------------------------------------------------------------------------------------------------------|
| `postGain` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):desired value in decibels (dB) |

### setRatio

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

```
fun setRatio(ratio: Float): Unit
```

sets limiter compressor ratio (N:1)

|                                                            Parameters                                                            ||
|---------|-------------------------------------------------------------------------------------------------------------------------|
| `ratio` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):desired for the limiter compressor (N:1) |

### setReleaseTime

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

```
fun setReleaseTime(releaseTime: Float): Unit
```

sets release time for limiter compressor in milliseconds (ms)

|                                                                    Parameters                                                                     ||
|---------------|------------------------------------------------------------------------------------------------------------------------------------|
| `releaseTime` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):desired for limiter compressor in milliseconds (ms) |

### setThreshold

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

```
fun setThreshold(threshold: Float): Unit
```

sets the limiter compressor threshold measured in decibels (dB) from 0 dB Full Scale (dBFS). Thresholds are negative. A threshold of 0 dB means no limiting will take place.

|                                                                 Parameters                                                                 ||
|-------------|-------------------------------------------------------------------------------------------------------------------------------|
| `threshold` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):desired for limiter compressor in decibels(dB) |

### toString

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

```
fun toString(): String
```

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |