ALLEGRO_MIXER(3alleg5)
π ALLEGRO_MIXER π
okay bestie, welcome to the Allegro 5 API manual, mixer edition π this whole page is part of the Allegro reference manual situation and it's literally about the lil struct that stirs all ur audio together. no cap.
β¨ NAME β¨
ALLEGRO_MIXER β the Allegro 5 API's very own mixer type, and yes she's iconic π
π SYNOPSIS π
#include <allegro5/allegro_audio.h>
typedef struct ALLEGRO_MIXER ALLEGRO_MIXER;
that's it. that's the whole vibe. two lines and she's already serving π
π¦ DESCRIPTION π¦
so what is a mixer, u ask? bestie. a mixer mixes together all the attached streams into one single buffer. like, one buffer. that's the whole job and she does it flawlessly π
and while she's doing that, she's also doing the most β converting:
- channel configurations
- sample frequencies
- audio depths
of all the attached sample instances and audio streams, accordingly β¨ so like, everyone shows up looking however they look and she makes them all match. queen behaviour.
and if u wanna control the quality of this conversion? that's a thing u can do! just use ALLEGRO_MIXER_QUALITY π
π the math part (yes there's math, stay with me)
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 β but only if that center channel is present, iykyk.
ngl the sqrt(2) stuff is just the mixer keeping the loudness from getting out of hand when channels get squished together or duplicated. it's giving considerate. it's giving main character energy. periodt π«Ά
π that's the whole page π
fr fr, she's short but she's powerful. go mix something beautiful, bestie πΈ
written up all cute from the Allegro reference manual, version 3alleg5 (that's the ALLEGRO_MIXER(3alleg5) footer energy, but make it a sign-off) π§ββοΈπ bye bye, go read the rest of the Allegro 5 API and slay β
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms