Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

AudioEffectCompressor

Inherits: AudioEffect < Resource < RefCounted < Object

Adds a compressor audio effect to an audio bus.

Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume.

Description

Dynamic range compressor reduces the level of the sound when the amplitude goes over a certain threshold in Decibels. One of the main uses of a compressor is to increase the dynamic range by clipping as little as possible (when sound goes over 0dB).

Compressor has many uses in the mix:

  • In the Master bus to compress the whole output (although an AudioEffectLimiter is probably better).

  • In voice channels to ensure they sound as balanced as possible.

  • Sidechained. This can reduce the sound level sidechained with another audio bus for threshold detection. This technique is common in video game mixing to the level of music and SFX while voices are being heard.

  • Accentuates transients by using a wider attack, making effects sound more punchy.

Tutorials

Properties

float

attack_us

20.0

float

gain

0.0

float

mix

1.0

float

ratio

4.0

float

release_ms

250.0

StringName

sidechain

&""

float

threshold

0.0


Property Descriptions

float attack_us = 20.0

  • void set_attack_us ( float value )

  • float get_attack_us ( )

Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000.


float gain =