Table of Contents

Class AudioEffectCompressor

Namespace
Godot
Assembly
GodotSharp.dll

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.

public class AudioEffectCompressor : AudioEffect, IDisposable
Inheritance
AudioEffectCompressor
Implements
Inherited Members

Constructors

AudioEffectCompressor()

public AudioEffectCompressor()

Properties

AttackUs

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

public float AttackUs { get; set; }

Property Value

float

Gain

Gain applied to the output signal.

public float Gain { get; set; }

Property Value

float

Mix

Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet).

public float Mix { get; set; }

Property Value

float

Ratio

Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48.

public float Ratio { get; set; }

Property Value

float

ReleaseMs

Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000.

public float ReleaseMs { get; set; }

Property Value

float

Sidechain

Reduce the sound level using another audio bus for threshold detection.

public StringName Sidechain { get; set; }

Property Value

StringName

Threshold

The level above which compression is applied to the audio. Value can range from -60 to 0.

public float Threshold { get; set; }

Property Value

float

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool