al_destroy_sample(3alleg5)
π 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
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms