get_sound_input_cap_rate(3)

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

✨ 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 🫢


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