al_play_audio_stream_f(3alleg5)
π al_play_audio_stream_f β NAME π
okay bestie, gather round: this is the Allegro 5 API page for al_play_audio_stream_f, and she's a cutie with a very specific job. β¨
π SYNOPSIS π
#include <allegro5/allegro_audio.h>
ALLEGRO_AUDIO_STREAM *al_play_audio_stream_f(ALLEGRO_FILE *fp, const char *ident)
like, that's the whole vibe right there. one function, two args, endless possibilities. π
πΈ DESCRIPTION πΈ
So what does she do? She loads and plays an audio file straight out of an ALLEGRO_FILE(3alleg5) stream, and she streams it whenever streaming is needed. no cap. π§
π¨ real talk: this API can only play one audio stream at a time. one. singular. she is not sharing the aux. π
She also needs a default mixer to already be set up, which β plot twist β is typically handled for you by al_reserve_samples(3alleg5), but you can also do it yourself with al_set_default_mixer(3alleg5). either way, mixer first, queen. π
The file type isn't guessed or sniffed or anything β it's determined entirely by the ident parameter you pass in, which is a file name extension including the leading dot. so like .ogg, .wav, whatever β the dot matters. periodt. π¦
Returns the stream on success, and NULL on failure. that's the vibe check. β
Now the important part, listen up:
- You must not destroy the returned stream. she gets automatically destroyed when the addon is shut down. hands off. π
- On success, the file should be considered owned by the audio stream, and it'll be closed when the audio stream is destroyed.
- On failure, the file will be closed too. so either way, the file's fate is sealed. π
β οΈ Note: theallegro_audiolibrary does not support any audio file formats by default. You must use theallegro_acodecaddon, or register your own format handler. otherwise she's just standing there with nothing to play. π§
π SEE ALSO π
go read those next, iykyk. π
β SINCE β
5.2.8
[Unstable API]: New API. β¨ she's new here, be nice to her.
and that's the whole page, bestie!! π«Ά this was the al_play_audio_stream_f(3alleg5) page from the Allegro reference manual β stay iconic, go stream some audio (one at a time, obviously), and slay. πππ₯
π¦ 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