AudioEffectCompressor
Adds a compressor audio effect to an audio bus.
AudioEffectCompressor.swift:31class AudioEffectCompressor
Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume.
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.
Superclasses
class AudioEffect
Base class for audio effect resources.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var attackUs: Double
Compressor’s reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000.
var gain: Double
Gain applied to the output signal.
var mix: Double
Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet).
var ratio: Double
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.
var releaseMs: Double
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.
var sidechain: StringName
Reduce the sound level using another audio bus for threshold detection.
var threshold: Double
The level above which compression is applied to the audio. Value can range from -60 to 0.