ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
noise_gate_t Struct Reference

This is the handoff point for compressor. Callers fill threshold_dB, knee_dB, ratio, attack_ns before passing it on; consumers read the values during the operation and return ownership only where the member contract explicitly says they do. More...

#include <include/ascii-chat/audio/mixer.h>

Data Fields

float threshold
 Gate threshold in linear units (e.g., 0.01f for -40dB).
uint64_t attack_ns
 Attack time in nanoseconds (how fast gate opens).
uint64_t release_ns
 Release time in nanoseconds (how fast gate closes).
float hysteresis
 Hysteresis factor (0-1, prevents gate chatter).
float sample_rate
 Sample rate in Hz (set during initialization).
float envelope
 Current envelope follower state (linear, 0-1).
float attack_coeff
 Attack coefficient (converted from attack_ms).
float release_coeff
 Release coefficient (converted from release_ms).
bool gate_open
 True if gate is currently open (allowing audio through).

Detailed Description

This is the handoff point for compressor. Callers fill threshold_dB, knee_dB, ratio, attack_ns before passing it on; consumers read the values during the operation and return ownership only where the member contract explicitly says they do.

Noise-gate thresholds, smoothing coefficients, and live open/closed state.

This object suppresses microphone or mixed-audio samples below threshold. Uses hysteresis to prevent gate chatter (rapid opening/closing).

GATE BEHAVIOR:

  • Closes (mutes) when input is below threshold
  • Opens (allows through) when input is above threshold
  • Hysteresis prevents rapid on/off cycling
  • Smooth attack/release prevents clicks and pops
Note
Hysteresis means gate opens at threshold but closes at threshold * hysteresis (lower level), preventing chatter.

Definition at line 183 of file mixer.h.


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