web api interface
DynamicsCompressorNode
The DynamicsCompressorNode interface provides a compression effect, which lowers the volume of the loudest parts of a signal.
Compression can help prevent clipping and distortion when multiple sounds are combined, and it is also used in music production and game audio for dynamic control, tone shaping, and creative effects.
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" |
Constructor
DynamicsCompressorNode()- : Creates a new instance of a
DynamicsCompressorNodeobject.
- : Creates a new instance of a
Instance properties
Inherits properties from its parent, AudioNode.
thresholdRead only- : A k-rate
AudioParamrepresenting the decibel value above which the compression will start taking effect.
- : A k-rate
kneeRead only- : A k-rate
AudioParamcontaining a decibel value representing the range above the threshold where the curve smoothly transitions to the compressed portion.
- : A k-rate
ratioRead only- : A k-rate
AudioParamrepresenting the amount of change, in dB, needed in the input for a 1 dB change in the output.
- : A k-rate
reductionRead only- : A
floatrepresenting the amount of gain reduction currently applied by the compressor to the signal.
- : A
attackRead only- : A k-rate
AudioParamrepresenting the amount of time, in seconds, required to reduce the gain by 10 dB.
- : A k-rate
releaseRead only- : A k-rate
AudioParamrepresenting the amount of time, in seconds, required to increase the gain by 10 dB.
- : A k-rate
Instance methods
No specific methods; inherits methods from its parent, AudioNode.
Example
See BaseAudioContext.createDynamicsCompressor() example code.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.