ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
mixer.c File Reference

🎚️ Real-time audio mixer with ducking, gain control, and multi-stream blending More...

Go to the source code of this file.

Data Structures

struct  mixer_listener_buffer
 Owns the temporary storage used by mixer listener buffer. The data pointers and size or cursor fields describe the live portion of the allocation; callers must use the type's cleanup path when the buffer or queue is no longer needed. More...

Macros

#define MIXER_LISTENER_SAMPLES   8192
#define M_PI   3.14159265358979323846

Typedefs

typedef struct mixer_listener_buffer mixer_listener_buffer_t
 Owns the temporary storage used by mixer listener buffer. The data pointers and size or cursor fields describe the live portion of the allocation; callers must use the type's cleanup path when the buffer or queue is no longer needed.

Functions

int ducking_init (ducking_t *duck, int num_sources, float sample_rate)
 Initialize ducking system.
void ducking_destroy (ducking_t *duck)
 Free ducking system resources.
void ducking_set_params (ducking_t *duck, float threshold_dB, float leader_margin_dB, float atten_dB, uint64_t attack_ns, uint64_t release_ns)
 Set ducking parameters.
void ducking_process_frame (ducking_t *duck, float *envelopes, float *gains, int num_sources)
 Process a frame of audio through ducking system.
mixer_t * mixer_create (int max_sources, int sample_rate)
 Create a new audio mixer.
mixer_t * mixer_create_channels (int max_sources, int sample_rate, unsigned channels)
void mixer_destroy (mixer_t *mixer)
 Destroy a mixer and free all resources.
int mixer_add_source (mixer_t *mixer, const char *client_id, audio_ring_buffer_t *buffer)
 Add an audio source to the mixer.
void mixer_remove_source (mixer_t *mixer, const char *client_id)
 Remove an audio source from the mixer.
int mixer_source_count (const mixer_t *mixer)
void mixer_set_source_active (mixer_t *mixer, const char *client_id, bool active)
 Set whether a source is active (receiving audio).
int mixer_process (mixer_t *mixer, float *output, int num_samples)
 Process audio from all active sources.
int mixer_process_excluding_source (mixer_t *mixer, float *output, int num_samples, uint32_t exclude_client_id)
 Process audio from all sources except one (for per-client output).

Detailed Description

🎚️ Real-time audio mixer with ducking, gain control, and multi-stream blending

Definition in file mixer.c.

Macro Definition Documentation

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 68 of file mixer.c.

◆ MIXER_LISTENER_SAMPLES

#define MIXER_LISTENER_SAMPLES   8192

Definition at line 25 of file mixer.c.

Referenced by mixer_process_excluding_source().

Typedef Documentation

◆ mixer_listener_buffer_t

Owns the temporary storage used by mixer listener buffer. The data pointers and size or cursor fields describe the live portion of the allocation; callers must use the type's cleanup path when the buffer or queue is no longer needed.