|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Main mixer structure for multi-source audio processing. More...
#include <lib/audio/mixer.h>
Data Fields | |
| int | num_sources |
| Current number of active audio sources. | |
| int | max_sources |
| Maximum number of sources (allocated array sizes) | |
| int | sample_rate |
| Sample rate in Hz (e.g., 44100) | |
| audio_ring_buffer_t ** | source_buffers |
| Array of pointers to client audio ring buffers. | |
| uint32_t * | source_ids |
| Array of client IDs (one per source slot) | |
| bool * | source_active |
| Array of active flags (true if source is active) | |
| uint64_t | active_sources_mask |
| Bitset of active sources (bit i = source i is active, O(1) iteration) | |
| uint8_t | source_id_to_index [256] |
| Hash table mapping client_id → mixer source index (uses hash function for 32-bit IDs) | |
| uint32_t | source_id_at_hash [256] |
| Client IDs stored at each hash index for collision detection. | |
| rwlock_t | source_lock |
| Reader-writer lock protecting source arrays and bitset. | |
| float | crowd_alpha |
| Crowd scaling exponent (typically 0.5 for sqrt scaling) | |
| float | base_gain |
| Base gain before crowd scaling is applied. | |
| ducking_t | ducking |
| Ducking system (active speaker detection and attenuation) | |
| compressor_t | compressor |
| Compressor (dynamic range compression) | |
| float * | mix_buffer |
| Temporary buffer for mixing operations (pre-allocated) | |
Main mixer structure for multi-source audio processing.
Manages multiple audio sources (clients) and processes them through a professional audio processing pipeline. Supports up to MIXER_MAX_SOURCES simultaneous sources with automatic crowd scaling and active speaker detection.
MIXER ARCHITECTURE:
PERFORMANCE OPTIMIZATIONS: