ALLEGRO_AUDIO_DEPTH(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– ALLEGRO_AUDIO_DEPTH πŸ’–

okay bestie, welcome to the Allegro 5 API corner of the manual, this one's ALLEGRO_AUDIO_DEPTH(3alleg5) and it's literally all about how your audio samples are shaped. sit down, hydrate, let's go πŸŽ€


✨ SYNOPSIS ✨

#include <allegro5/allegro_audio.h>

enum ALLEGRO_AUDIO_DEPTH

🌸 DESCRIPTION 🌸

so this enum is giving sample depth, sample type, and also signedness β€” like, all three at once, main character energy fr fr. πŸ’…

the tea on mixers: they only mess with 32-bit signed float (that's the -1..+1 range, cutie) or 16-bit signed integers. that's it. that's the whole vibe. 🫢

and the signedness situation? it's not a separate enum, no no. it's an β€œunsigned” bit-flag that gets applied on top of the depth value. sneaky but iconic. ✨

here's the whole lineup of depth values:

  • ALLEGRO_AUDIO_DEPTH_INT8
  • ALLEGRO_AUDIO_DEPTH_INT16
  • ALLEGRO_AUDIO_DEPTH_INT24
  • ALLEGRO_AUDIO_DEPTH_FLOAT32
  • ALLEGRO_AUDIO_DEPTH_UNSIGNED

and because the Allegro girlies are thoughtful like that, for convenience you also get the unsigned ones pre-combined, no bit-math required:

  • ALLEGRO_AUDIO_DEPTH_UINT8
  • ALLEGRO_AUDIO_DEPTH_UINT16
  • ALLEGRO_AUDIO_DEPTH_UINT24
lowkey important: that ALLEGRO_AUDIO_DEPTH_UNSIGNED is a flag you OR onto a depth, it's not a depth on its own. iykyk. 🧚

okay that's the whole page, you ate it, you understood it, periodt. πŸ‘‘

this was served fresh from the Allegro reference manual, page ALLEGRO_AUDIO_DEPTH(3alleg5) β€” mwah, go make some sounds bestie πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from