Constructor
new AudioCompressor(thresholdopt, ratioopt, mixopt)
Create a compressor effect
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
threshold | number | <optional> | Level in dB above which the signal is reduced | |
ratio | number | <optional> | 12 | How much to reduce it, 12 means 12 dB in becomes 1 dB out |
mix | number | <optional> | 1 | Wet/dry balance, 0 is fully dry and 1 is fully wet |
- Source
Example
const compressor = new AudioCompressor;
setAudioMasterEffect(compressor);Extends
- AudioEffect
Members
node
Properties| Type | Description |
|---|---|
| DynamicsCompressorNode | The compressor node |
- Source
Methods
setRatio(ratio, fadeTimeopt)
Set how much the signal is reduced above the threshold
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
ratio | number | 1 is no reduction, 20 is a hard limit | ||
fadeTime | number | <optional> | 0 | Seconds to ramp over |
- Source
setThreshold(threshold, fadeTimeopt)
Set the level above which the signal is reduced
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
threshold | number | Level in dB | ||
fadeTime | number | <optional> | 0 | Seconds to ramp over |
- Source