al_load_audio_stream(3alleg5)

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

πŸ’– al_load_audio_stream πŸ’–

okay bestie, welcome to the Allegro 5 API corner of the Allegro reference manual ✨ this one's called al_load_audio_stream and it's literally the girlboss of lazy-loading your tunes πŸŽ€


✨ SYNOPSIS ✨

#include <allegro5/allegro_audio.h>

ALLEGRO_AUDIO_STREAM *al_load_audio_stream(const char *filename,
   size_t buffer_count, unsigned int samples)

🌸 DESCRIPTION 🌸

so the whole vibe here is: it loads an audio file from disk as it is needed. like, not all at once. she's patient. she's chill. she streams πŸ’…

and here's the part that makes her different from regular streams, no cap: the stream you get back from this function does not need to be fed by you. nope, not your job, not your problem 🫢 the library will automatically read more of the file as it is needed. iconic behaviour honestly.

the stream will contain buffer_count buffers, and each one has samples samples in it. that's the tea β˜•

heads up though β€” the audio stream starts out in the playing state. but bestie, she's not gonna make a single sound on her own 😭 you have to attach her to a voice or a mixer to generate any output. then she eats. see ALLEGRO_AUDIO_STREAM(3alleg5) for more details, iykyk.

Returns the stream on success, and NULL on failure. that's it, that's the return value 🌈

Note: the allegro_audio library does not support any audio file formats by default. not one. zero. nada πŸ’€ you must use the allegro_acodec addon, or register your own format handler. no shortcuts, bestie.

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, bestie!! go forth and stream your audio, you absolute main character πŸ‘‘ πŸŽ€βœ¨

this has been the Allegro reference manual, page al_load_audio_stream(3alleg5), brought to you with love, sparkles, and zero copy-pasted manpage energy πŸ’–πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from