al_destroy_sample(3alleg5)

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

πŸ’– al_destroy_sample πŸ’–

okay bestie, welcome to the Allegro 5 API corner of the Allegro reference manual ✨ this one's short and sweet and honestly kinda iconic πŸŽ€


🌸 NAME 🌸

al_destroy_sample β€” Allegro 5 API πŸ’…


✨ SYNOPSIS ✨

#include <allegro5/allegro_audio.h>

void al_destroy_sample(ALLEGRO_SAMPLE *spl)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. this is the moment where your sample says its goodbyes and moves out 🫢 this function frees the sample data structure. no cap, it's gone, it's giving closure πŸ’€

and here's the little detail you do NOT wanna skip, bestie: if that sample was created with the free_buf parameter set to true, then the buffer gets freed too, using al_free(3alleg5) ✨ so like, double cleanup, the whole vibe gets swept away 🌈

also, and this is the part that's lowkey important: this function will stop any sample instances which may be playing the buffer referenced by the ALLEGRO_SAMPLE(3alleg5) πŸ›‘ so no zombie audio haunting you after you've already said bye. she's thorough, she's responsible, she's the main character πŸ‘‘

⚠️ heads up: don't go using that ALLEGRO_SAMPLE after this, bestie. it's been freed. that's a one-way trip πŸ™ˆ

🌟 SEE ALSO 🌟


k bye, this page came straight out of the Allegro reference manual β€” al_destroy_sample(3alleg5), mwah πŸ’‹ slay, go free your samples responsibly πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from