ALLEGRO_AUDIO_DEPTH(3)
π ALLEGRO_AUDIO_DEPTH π
okay so bestie, we're diving into the Allegro 5 API today β this is from the Library Functions Manual, section 3, and it's all about ALLEGRO_AUDIO_DEPTH. it's a little enum that tells you how audio samples are stored. not scary, i promise. π
β¨ NAME β¨
ALLEGRO_AUDIO_DEPTH β literally just the Allegro 5 API. that's the whole vibe. π
π¦ SYNOPSIS π¦
like, here's how you actually get to it:
#include <allegro5/allegro_audio.h>
enum ALLEGRO_AUDIO_DEPTH
yes queen, it's an enum. she's a type. π«Ά
πΈ DESCRIPTION πΈ
so what is this actually for? it describes a sample's depth (how many bits), its type (int or float), and its signedness (signed or unsigned). the whole thing in one neat little package.
here's the tea though β mixers only use 32-bit signed float (range -1..+1), or 16-bit signed integers. that's it. that's the whole menu for mixers. anything else is not getting mixed, periodt. π
and how does signedness work?? it's determined by an "unsigned" bit-flag that gets applied on top of the depth value. cute, right? a little bit-flag doing a lot of work. π₯
so the actual depth values are:
ALLEGRO_AUDIO_DEPTH_INT8β 8-bit signed integer, bestie πALLEGRO_AUDIO_DEPTH_INT16β 16-bit signed integer, iconic πALLEGRO_AUDIO_DEPTH_INT24β 24-bit signed integer, highkey fancy βALLEGRO_AUDIO_DEPTH_FLOAT32β 32-bit float, main character energy πALLEGRO_AUDIO_DEPTH_UNSIGNEDβ the bit-flag itself, flip it to make things unsigned π
π For convenience π
because the Allegro girlies are always thinking of us, they pre-combined the unsigned flag with the int depths so you don't have to:
ALLEGRO_AUDIO_DEPTH_UINT8β 8-bit unsigned πALLEGRO_AUDIO_DEPTH_UINT16β 16-bit unsigned π§ALLEGRO_AUDIO_DEPTH_UINT24β 24-bit unsigned π¦
so instead of doing the flag math yourself, you just grab the UINT version. no cap, it's giving convenience. π
ngl, remember: convenience names or not, mixers still only touch 32-bit signed float and 16-bit signed int. don't come for me, that's just what the page says π
π« sign-off π«
and that's the page!! this was the Allegro reference manual edition of ALLEGRO_AUDIO_DEPTH(3), brought to you by the fine folks who maintain the Allegro docs. go make some noise, bestie πΈβ¨π
π¦ 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