get_sound_input_cap_rate(3)
β¨ get_sound_input_cap_rate(3) β¨
okay bestie, welcome to the Allegro manual π you're in the section 3 girlies today and we're talking about recording audio, so grab your headphones π§
πΈ NAME πΈ
get_sound_input_cap_rate</ppurple> β Returns the maximum sample frequency for recording. Allegro game programming library. π
π¦ SYNOPSIS π¦
#include <allegro.h>
int get_sound_input_cap_rate(int bits, int stereo);
π DESCRIPTION π
so like, this one is the vibe check for your recording setup β¨ You hand it a format, and it tells you the maximum possible sample frequency you can record at in that exact format. And if your settings are just not it? It hands you back zero. no cap, zero means "bestie that format is not supported, try again" π
Let's break down the params, iykyk:
bitsβ this is the number of bits of the audio ποΈstereoβ this is a boolean, bestie. Pass zero for mono, and non-zero for stereo input π
and here's the example straight from the source, not me paraphrasing, we keep it exact fr fr:
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. */
}
like, look at her go π₯Ή asking "what frequency can we record 8 bits mono at?" and then checking if it's above 22000. iconic.
π SEE ALSO π
the sister functions, the whole squad, we love a family π«Ά
start_sound_input(3)get_sound_input_cap_parm(3)get_sound_input_cap_bits(3)get_sound_input_cap_stereo(3)
and that's the whole page, bestie, you ate that π this was Allegro version 4.4.3, go forth and record at the highest frequency your format allows, main character energy only πβπ
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms