9 typedef struct Compressor
{
25 ALfloat Envelope
[BUFFERSIZE
];
29 /* The compressor requires the following information for proper
32 * PreGainDb - Gain applied before detection (in dB).
33 * PostGainDb - Gain applied after compression (in dB).
34 * SummedLink - Whether to use summed (true) or maxed (false) linking.
35 * RmsSensing - Whether to use RMS (true) or Peak (false) sensing.
36 * AttackTimeMin - Minimum attack time (in seconds).
37 * AttackTimeMax - Maximum attack time. Automates when min != max.
38 * ReleaseTimeMin - Minimum release time (in seconds).
39 * ReleaseTimeMax - Maximum release time. Automates when min != max.
40 * Ratio - Compression ratio (x:1). Set to 0 for true limiter.
41 * ThresholdDb - Triggering threshold (in dB).
42 * KneeDb - Knee width (below threshold; in dB).
43 * SampleRate - Sample rate to process.
45 Compressor
*CompressorInit(const ALfloat PreGainDb
, const ALfloat PostGainDb
,
46 const ALboolean SummedLink
, const ALboolean RmsSensing
, const ALfloat AttackTimeMin
,
47 const ALfloat AttackTimeMax
, const ALfloat ReleaseTimeMin
, const ALfloat ReleaseTimeMax
,
48 const ALfloat Ratio
, const ALfloat ThresholdDb
, const ALfloat KneeDb
,
49 const ALuint SampleRate
);
51 void ApplyCompression(struct Compressor
*Comp
, const ALsizei NumChans
, const ALsizei SamplesToDo
,
52 ALfloat (*restrict OutBuffer
)[BUFFERSIZE
]);
54 inline ALuint
GetCompressorSampleRate(const Compressor
*Comp
)
55 { return Comp
->SampleRate
; }
57 #endif /* MASTERING_H */