ALLEGRO_AUDIO_DEPTH(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’– 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