Skip to content

DynamicsCompressorNode

Hans Lindetorp edited this page Feb 24, 2021 · 2 revisions

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.

Attributes:

  • attack
  • knee
  • ratio
  • reduction
  • release
  • threshold

Example

<?xml version="1.0" encoding="UTF-8"?>
<Audio version="1.0" timeUnit="ms" interactionArea="#touchArea" gain="-10dB">
  <Chain>
    <AudioBufferSourceNode loop="true" src="loop.mp3" trig="pointer"></AudioBufferSourceNode>
    <DynamicsCompressorNode ratio="20" threshold="-40"></BiquadFilterNode>
  </Chain>
</Audio>

Read more: https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode

Clone this wiki locally