al_load_sample(3alleg5)

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

πŸ’– NAME πŸ’–

al_load_sample β€” it's giving Allegro 5 API, bestie ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro5/allegro_audio.h>

ALLEGRO_SAMPLE *al_load_sample(const char *filename)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. al_load_sample is literally the girl who pulls up your audio files and figures out what format they are based on their extension. A few different audio file formats, no big deal, she's got range πŸ’…

⚠️ but bestie, hear me out β€” this one stores the entire file in memory at once. all of it. the whole thing. which may be time consuming 😭 like she's committed, she's not doing anything halfway, but that means you're waiting.

if you'd rather read the file as it is needed instead of slurping the whole thing into RAM, go hang out with al_load_audio_stream(3alleg5) or al_play_audio_stream(3alleg5) instead. they're the lowkey chill ones 🫢

She returns the sample on success, and NULL on failure. iconic behavior, no notes. πŸ‘‘

🚨 Note: the allegro_audio library does not support any audio file formats by default. like zero. none. nada. πŸ’€ You must use the allegro_acodec addon, or register your own format handler. that's not optional, that's the vibe check and you failed it if you skip this step.

🌸 SEE ALSO 🌸


and that's the whole page, periodt πŸ’œ this was the Allegro reference manual entry for al_load_sample, from the 3alleg5 manual β€” go forth and load your samples responsibly, mwah 🧚✨

πŸ“¦ where this page comes from