AudioEffects. AudioCompressor

Compressor effect, evens out loud and quiet so many sounds at once don't clip

  • Meant for the master bus, it is not on by default

Constructor

new AudioCompressor(thresholdopt, ratioopt, mixopt)

Create a compressor effect

Parameters:
NameTypeAttributesDefaultDescription
thresholdnumber<optional>

Level in dB above which the signal is reduced

rationumber<optional>
12

How much to reduce it, 12 means 12 dB in becomes 1 dB out

mixnumber<optional>
1

Wet/dry balance, 0 is fully dry and 1 is fully wet

Example
const compressor = new AudioCompressor;
setAudioMasterEffect(compressor);

Extends

  • AudioEffect

Members

node

Properties
TypeDescription
DynamicsCompressorNode

The compressor node

Methods

setRatio(ratio, fadeTimeopt)

Set how much the signal is reduced above the threshold

Parameters:
NameTypeAttributesDefaultDescription
rationumber

1 is no reduction, 20 is a hard limit

fadeTimenumber<optional>
0

Seconds to ramp over

setThreshold(threshold, fadeTimeopt)

Set the level above which the signal is reduced

Parameters:
NameTypeAttributesDefaultDescription
thresholdnumber

Level in dB

fadeTimenumber<optional>
0

Seconds to ramp over