GET_SOUND_INPUT_CAP_RATE(3alleg4)
π get_sound_input_cap_rate β NAME β¨
okay bestie, so this one is get_sound_input_cap_rate β she returns the maximum sample frequency for recording ποΈπ
and yeah, she lives in the Allegro game programming library π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int get_sound_input_cap_rate(int bits, int stereo);
like, that's the whole vibe. two args, one int back. periodt π
π¦ DESCRIPTION π¦
So basically πββοΈ β this function hands you back the maximum possible sample frequency for recording in the format you asked for. And if your settings are justβ¦ not it? Not supported? She gives you zero. π zero is the "nope, can't do that" answer, no cap.
Now let's talk about the two things you gotta pass her:
bitsβ this is literally just the number of bits of the audio. like how many bits, that's it.stereoβ this one's a boolean parameter, so think of it as a yes/no vibe check. Pass zero for mono π and non-zero for stereo input π.
and here's an example, bestie, so you can see it in the wild:
int max_freq;
...
/* What frequency can we record 8 bits mono at? */
max_freq = get_sound_input_cap_rate(8, 0);
if (max_freq > 22000) {
/* Ok, 22KHz and above is good enough. */
}
see what she did there?? asked for 8 bits, mono (0), and then checked if the answer was above 22000 because 22KHz and up is lowkey good enough. iconic behavior honestly π₯
π SEE ALSO π
if you're obsessed with this one (and you should be), go check out her besties too:
start_sound_input(3alleg4)get_sound_input_cap_parm(3alleg4)get_sound_input_cap_bits(3alleg4)get_sound_input_cap_stereo(3alleg4)
that's the whole page, my love π go record something beautiful πΈβ¨
mwah π this was Allegro, version 4.4.3 β and that's the tea, fr fr π«Ά
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms