ALLEGRO_MIXER(3)
π ALLEGRO_MIXER π
okay bestie, welcome to the Allegro 5 API corner of the Allegro reference manual β this one's all about the mixer, and it's honestly kind of the main character of your audio setup π
β¨ NAME β¨
ALLEGRO_MIXER β the Allegro 5 API's very own mixer, no cap π
π¦ SYNOPSIS π¦
#include <allegro5/allegro_audio.h>
typedef struct ALLEGRO_MIXER ALLEGRO_MIXER;
πΈ DESCRIPTION πΈ
So like, a mixer mixes together all the streams you've attached to it into a single buffer. That's the whole vibe. π«Ά
And the way that it's doing all this while it goes β it converts the channel configurations, sample frequencies and audio depths of the attached sample instances and audio streams accordingly. Like it just handles it, periodt. β¨
You can control the quality of this conversion using ALLEGRO_MIXER_QUALITY β iykyk, go tweak that if you care about the conversion being extra crispy π
Now for the deets on the volume math, because this part is important and lowkey iconic:
- When going from mono to stereo (and above), the mixer reduces the volume of both channels by
sqrt(2). π - When going from stereo (and above) to mono, the mixer reduces the volume of the left and right channels by
sqrt(2)before adding them to the center channel (if present). π
fr fr, don't sleep on those sqrt(2) numbers β they're literally in there, bestie, and they're doing real work π§
okay that's the whole page, you ate that π this little love letter came to you straight from the Allegro reference manual, repping ALLEGRO_MIXER(3) β mwah, go make something sound gorgeous πβ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms