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

Go to the source code of this file.

Macros

#define M_PI   3.14159265358979323846

Functions

float db_to_linear (float db)
 Convert decibels to linear gain.
float linear_to_db (float linear)
 Convert linear gain to decibels.
float clamp_float (float value, float min, float max)
 Clamp a float value to a range.
void compressor_init (compressor_t *comp, float sample_rate)
 Initialize a compressor.
void compressor_set_params (compressor_t *comp, float threshold_dB, float ratio, uint64_t attack_ns, uint64_t release_ns, float makeup_dB)
 Set compressor parameters.
float compressor_process_sample (compressor_t *comp, float sidechain)
 Process a single sample through compressor.
void noise_gate_init (noise_gate_t *gate, float sample_rate)
 Initialize a noise gate.
void noise_gate_set_params (noise_gate_t *gate, float threshold, uint64_t attack_ns, uint64_t release_ns, float hysteresis)
 Set noise gate parameters.
float noise_gate_process_sample (noise_gate_t *gate, float input, float peak_amplitude)
 Process a single sample through noise gate.
void noise_gate_process_buffer (noise_gate_t *gate, float *buffer, int num_samples)
 Process a buffer of samples through noise gate.
bool noise_gate_is_open (const noise_gate_t *gate)
 Check if noise gate is currently open.
void highpass_filter_init (highpass_filter_t *filter, float cutoff_hz, float sample_rate)
 Initialize a high-pass filter.
void highpass_filter_reset (highpass_filter_t *filter)
 Reset high-pass filter state.
float highpass_filter_process_sample (highpass_filter_t *filter, float input)
 Process a single sample through high-pass filter.
void highpass_filter_process_buffer (highpass_filter_t *filter, float *buffer, int num_samples)
 Process a buffer of samples through high-pass filter.
void lowpass_filter_init (lowpass_filter_t *filter, float cutoff_hz, float sample_rate)
 Initialize a low-pass filter.
void lowpass_filter_reset (lowpass_filter_t *filter)
 Reset low-pass filter state.
float lowpass_filter_process_sample (lowpass_filter_t *filter, float input)
 Process a single sample through low-pass filter.
void lowpass_filter_process_buffer (lowpass_filter_t *filter, float *buffer, int num_samples)
 Process a buffer of samples through low-pass filter.
float soft_clip (float sample, float threshold, float steepness)
 Apply soft clipping to a sample.
void soft_clip_buffer (float *buffer, int num_samples, float threshold, float steepness)
 Apply soft clipping to a buffer.
float smoothstep (float t)
 Compute smoothstep interpolation.
int16_t float_to_int16 (float sample)
 Convert float sample to int16 (WebRTC format).
float int16_to_float (int16_t sample)
 Convert int16 sample to float.
void buffer_float_to_int16 (const float *src, int16_t *dst, int count)
 Convert float buffer to int16 buffer.
void buffer_int16_to_float (const int16_t *src, float *dst, int count)
 Convert int16 buffer to float buffer.
float buffer_peak (const float *buffer, int count)
 Find peak absolute value in buffer.
void apply_gain_buffer (float *buffer, int count, float gain)
 Apply gain to buffer in-place.
void fade_buffer (float *buffer, int count, float start_gain, float end_gain)
 Apply linear fade to buffer in-place.
void fade_buffer_smooth (float *buffer, int count, bool fade_in)
 Apply smoothstep fade to buffer in-place.
void copy_buffer_with_gain (const float *src, float *dst, int count, float gain)
 Copy buffer with gain scaling.

Macro Definition Documentation

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 6 of file effects.c.

Referenced by digital_rain_init(), highpass_filter_init(), and lowpass_filter_init().