GET_SOUND_INPUT_CAP_BITS(3alleg4)

πŸ’– get_sound_input_cap_bits β€” aka "wait, can my audio input even DO that??" πŸ’–

okay bestie, so this one lives in the Allegro manual (yes, the Allegro game programming library, the whole vibe). It's get_sound_input_cap_bits, and it is exactly the kind of function you go looking for at 2am when your audio input is doing something mysterious and you need answers. ✨


🌸 SYNOPSIS 🌸

#include <allegro.h>

int get_sound_input_cap_bits();

πŸŽ€ DESCRIPTION πŸŽ€

so the whole job of this girl is: she checks which sample formats the current audio input driver actually supports, and hands you back one of these bitfield values. no cap, that's it, that's the tea. 🫢

  • 0 = audio input not supported πŸ’€
  • 8 = eight bit audio input is supported
  • 16 = sixteen bit audio input is supported
  • 24 = both eight and sixteen bit audio input are supported πŸ‘‘

and here's an example, because seeing it in action hits different:

cap = get_sound_input_cap_bits();
if (cap == 0) {
   /* Ugh, no audio input supported? */
} else {
   if (cap & 8) {
      /* We have eight bit audio input. */
   }
   if (cap & 16) {
      /* We have sixteen bit audio input. */
   }
}

like… the cap == 0 branch is giving tragic, but at least now you know, bestie. knowledge is power. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, gorgeous πŸ’œ this was the <b>Allegro</b> manual, <b>version 4.4.3</b> β€” mwah, go check your bitfield, ily, bye πŸŽ€βœ¨πŸ¦‹