ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
compressor_t Struct Reference

Dynamic range compressor settings and state. More...

#include <lib/audio/mixer.h>

Data Fields

float threshold_dB
 Compression threshold in dB (e.g., -10.0)
 
float knee_dB
 Knee width in dB for soft knee (e.g., 2.0)
 
float ratio
 Compression ratio (e.g., 4.0 for 4:1 compression)
 
float attack_ms
 Attack time in milliseconds (how fast compression kicks in)
 
float release_ms
 Release time in milliseconds (how fast compression releases)
 
float makeup_dB
 Makeup gain in dB (compensates for gain reduction)
 
float sample_rate
 Sample rate in Hz (set during initialization)
 
float envelope
 Current envelope follower state (linear, 0-1)
 
float gain_lin
 Current gain multiplier (linear, calculated from envelope)
 
float attack_coeff
 Attack coefficient (converted from attack_ms)
 
float release_coeff
 Release coefficient (converted from release_ms)
 

Detailed Description

Dynamic range compressor settings and state.

Implements professional-quality dynamic range compression to prevent clipping and maintain consistent output levels. Uses sidechain input for gain reduction calculation.

COMPRESSION BEHAVIOR:

  • Acts above threshold_dB (no compression below threshold)
  • Applies compression ratio (e.g., 4:1 reduces 4dB above threshold to 1dB)
  • Soft knee provides smooth compression curve transition
  • Independent attack/release times for natural sound
  • Makeup gain compensates for gain reduction
Note
All time-based parameters (attack_ms, release_ms) are converted to coefficients internally for sample-by-sample processing.

Definition at line 137 of file mixer.h.


The documentation for this struct was generated from the following file: