This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The DynamicsCompressorNode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once. This is often used in musical production and game audio. DynamicsCompressorNode is an AudioNode that has exactly one input and one output.
| Number of inputs | 1 |
|---|---|
| Number of outputs | 1 |
| Channel count mode | "clamped-max" |
| Channel count | 2 |
| Channel interpretation | "speakers" |
DynamicsCompressorNode()Creates a new instance of an DynamicsCompressorNode object.
Inherits properties from its parent, AudioNode.
DynamicsCompressorNode.threshold Read only
A k-rate AudioParam representing the decibel value above which the compression will start taking effect.
DynamicsCompressorNode.knee Read only
A k-rate AudioParam containing a decibel value representing the range above the threshold where the curve smoothly transitions to the compressed portion.
DynamicsCompressorNode.ratio Read only
A k-rate AudioParam representing the amount of change, in dB, needed in the input for a 1 dB change in the output.
DynamicsCompressorNode.reduction Read only
A float representing the amount of gain reduction currently applied by the compressor to the signal.
DynamicsCompressorNode.attack Read only
A k-rate AudioParam representing the amount of time, in seconds, required to reduce the gain by 10 dB.
DynamicsCompressorNode.release Read only
A k-rate AudioParam representing the amount of time, in seconds, required to increase the gain by 10 dB.
No specific methods; inherits methods from its parent, AudioNode.
See BaseAudioContext.createDynamicsCompressor() example code.
| Specification |
|---|
| Web Audio API> # DynamicsCompressorNode> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
DynamicsCompressorNode |
55 | 79 | 53 | 42 | 14.1 | 55 | 53 | 42 | 14.5 | 6.0 | 55 | 14.5 |
DynamicsCompressorNode |
14 | 12 | 25 | 15 | 6 | 18 | 25 | 14 | 6 | 1.0 | 4.4 | 6 |
attack |
19 | 12 | 25 | 15 | 6 | 25 | 25 | 14 | 6 | 1.5 | 4.4 | 6 |
knee |
19 | 12 | 25 | 15 | 6 | 25 | 25 | 14 | 6 | 1.5 | 4.4 | 6 |
ratio |
19 | 12 | 25 | 15 | 6 | 25 | 25 | 14 | 6 | 1.5 | 4.4 | 6 |
reduction |
19Before version 52, this was anAudioParam.. |
12 | 25 | 15 | 6 | 25Before version 52, this was anAudioParam.. |
25 | 14 | 6 | 1.0Before Samsung Internet 6.0, this was anAudioParam.. |
4.4Before version 52, this was anAudioParam.. |
6 |
release |
20 | 12 | 25 | 15 | 6 | 25 | 25 | 14 | 6 | 1.5 | 4.4 | 6 |
threshold |
19 | 12 | 25 | 15 | 6 | 25 | 25 | 14 | 6 | 1.5 | 4.4 | 6 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode