al_register_a..._stream_loader(3alleg5)

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

al_register_audio_stream_loader πŸ’–

okay bestie, welcome to the Allegro 5 API manual, we're doing this ✨


✨ NAME ✨

al_register_audio_stream_loader β€” the Allegro 5 API girlie who handles your audio stream loaders πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro5/allegro_audio.h>

bool al_register_audio_stream_loader(const char *ext,
   ALLEGRO_AUDIO_STREAM *(*stream_loader)(const char *filename,
      size_t buffer_count, unsigned int samples))

πŸ’… DESCRIPTION πŸ’…

so basically, this function registers a handler for al_load_audio_stream(3alleg5) and al_play_audio_stream(3alleg5). the function you hand over is the one that's gonna get used to open streams from files with the extension you specify. no cap. 🫢

now, about that extension β€” it should include the leading dot (.) character. yes, the dot. don't skip the dot. and it gets matched case-insensitively, so like, ".ogg" and ".OGG" are the same vibe, okurrr? 😌

the stream_loader argument? you can pass NULL to unregister an entry. iconic. bye bye loader. πŸ’€

as for what it returns:

  • it returns true on success ✨
  • it returns false on error 😭
  • and it also returns false if you're trying to unregister an entry that doesn't even exist β€” like, girl, there's nothing to unregister. false. periodt.
ngl, if you're getting false back, double-check whether you're registering or unregistering, and whether that entry was ever there in the first place. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘


that's the whole page bestie, you ate πŸ’– this was the Allegro reference manual, same title as always β€” al_register_a..._stream_loader(3alleg5) β€” so go forth and register those loaders, mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from