al_get_sample(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

al_get_sample β€” it's giving Allegro 5 API, bestie πŸ’– (this is from the Allegro reference manual, we'll circle back)


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_audio.h>

ALLEGRO_SAMPLE *al_get_sample(ALLEGRO_SAMPLE_INSTANCE *spl)

okay so that's the whole vibe, no cap πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

So like. You hand it a sample instance, and it hands you back the sample data that the sample instance plays. That's the whole job. Iconic honestly πŸ‘‘

BUT WAIT. 🚨 Not me about to save you from a whole confusion arc: this returns a pointer to an internal structure. It is not the ALLEGRO_SAMPLE(3alleg5) you may have passed to al_set_sample(3alleg5). Like, do not assume it's the same object, because it's literally not 🫢

That said?? Here's the slay part β€” the sample buffer of the returned ALLEGRO_SAMPLE will be the same as the one that was used to create the sample (the one that got passed to al_create_sample(3alleg5)). So the guts match even when the wrapper doesn't πŸ¦‹

And if you wanna actually check that for yourself? You can call al_get_sample_data(3alleg5) on the return value to retrieve it and compare it. Compare away, queen πŸ”₯

lowkey the move here: don't compare pointers, compare the buffer. iykyk ✨

πŸ’œ SEE ALSO πŸ’œ


and that's a wrap, bestie 🌈 this was al_get_sample(3alleg5) from the Allegro reference manual β€” go forth and retrieve your sample data responsibly πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from