get_sound_input_cap_bits(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ get_sound_input_cap_bits ✨

ok so bestie, we're in the Allegro manual today and this one's a lil function called get_sound_input_cap_bits. she's small, she's mighty, and she's here to tell you which audio input sample formats your current driver is actually vibing with. πŸ’–


🌸 NAME 🌸

get_sound_input_cap_bits β€” checks which audio input sample formats are supported. Allegro game programming library. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

int get_sound_input_cap_bits();

πŸ’… DESCRIPTION πŸ’…

ok so what she does is: she checks which sample formats are supported by the current audio input driver, and she hands you back one of these bitfield values. no cap, that's the whole job:

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
lowkey important: 24 is just 8 | 16 doing its little bitwise thing, so you can absolutely test the individual bits yourself. the example below does exactly that and honestly? she ate. πŸ”₯

Example, straight from the source, don't touch a single character:

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. */
   }
}

see how it works? if cap comes back as 0 you're in your no audio input era 😭 and if it's anything else you check the bits and see what you're working with. cap & 8 for eight bit, cap & 16 for sixteen bit. main character energy, honestly. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

go read those next bestie, they're all in the same squad 🫢


and that's the whole page, bestie! 🌈 this lil icon lives in Allegro, version 4.4.3, and it's filed under get_sound_input_cap_bits(3) β€” mwah, love that for her. πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from