|
arduino-audio-tools
|
Mixing of multiple audio input streams into a single output stream. More...
#include <AudioOutput.h>
Public Member Functions | |
| MixGain ()=default | |
| MixGain (float f) | |
| T | scale (T sample) const |
Public Attributes | |
| float | value = 0 |
Mixing of multiple audio input streams into a single output stream.
The OutputMixer allows you to combine multiple audio streams by summing their samples with configurable weights per channel. Each input stream is buffered independently using ring buffers, and the mixer outputs the combined result when all buffers have sufficient data available.
Features:
Auto Index Functionality: By default, auto-indexing is enabled (setAutoIndex(true)). When using the basic write() method without specifying a stream index, the mixer automatically:
This enables simple round-robin writing where you just call write() repeatedly and the mixer handles stream distribution and output flushing automatically.
Usage Examples:
Auto Index Mode (default):
Manual Index Mode:
| T | Audio sample data type (e.g., int16_t, int32_t, float) |
Applies a normalized [0,1] mixing gain to a full-range sample T, used by OutputMixer and InputMixer. The default (float) multiply works for any T, including T=float. Specialized for T=int16_t/int24_t/int32_t under PREFER_FIXEDPOINT to go through q1_14_t::scale() (integer-only) instead of a per-sample float multiply – the same technique used for VolumeStream's fixed-point volume path.
|
default |
|
inline |
|
inline |
| float value = 0 |