LittleJS 1.30.0

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

Extends AudioEffect

Constructor

new AudioCompressor(threshold, ratio, mix)audioEffects.js:336

Create a compressor effect

threshold number optional

Level in dB above which the signal is reduced

ratio number optional, default 12

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

mix number optional, default 1

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

const compressor = new AudioCompressor;
setAudioMasterEffect(compressor);

Members

Methods

Inherited from AudioEffect

Members

node : DynamicsCompressorNodeaudioEffects.js:350

The compressor node

Methods

setRatio(ratio, fadeTime)audioEffects.js:369

Set how much the signal is reduced above the threshold

ratio number

1 is no reduction, 20 is a hard limit

fadeTime number optional, default 0

Seconds to ramp over

setThreshold(threshold, fadeTime)audioEffects.js:359

Set the level above which the signal is reduced

threshold number

Level in dB

fadeTime number optional, default 0

Seconds to ramp over