al_play_audio_stream(3)
π NAME π
al_play_audio_stream β Allegro 5 API. also hi bestie, this page lives in the Library Functions Manual and itβs all about al_play_audio_stream(3) β¨
π SYNOPSIS π
#include <allegro5/allegro_audio.h>
ALLEGRO_AUDIO_STREAM *al_play_audio_stream(const char *filename)
π DESCRIPTION π
Okay so this function loads and plays an audio file, and it streams from disk as itβs needed β like, it reads on demand instead of needing the whole thing sitting there. iconic behavior honestly π
Real talk: this API can only play one audio stream at a time. One. Single. Stream. No sneaky multitasking streams here bestie.
It also requires a default mixer to be set. Usually thatβs done with al_reserve_samples(3), but it can also be done with al_set_default_mixer(3). Either way, the default mixer has to be there.
On success it returns the stream. On failure it returns NULL. Yep, thatβs the whole return vibe.
β οΈ warning bestie: you must not destroy the returned stream. It will be automatically destroyed when the addon is shut down. so do not touch it, do not free it, do not make it your project. let it live its life ππ«Ά
π Note: theallegro_audiolibrary does not support any audio file formats by default. You must use theallegro_acodecaddon, or register your own format handler. thatβs the tea.
π¦ SEE ALSO π¦
β SINCE β
5.2.8
Also flagged as: [Unstable API]: New API. so itβs new, itβs unstable, itβs giving fresh-out-the-box energy πβ¨
okay thatβs the whole page bestie β from the Allegro reference manual, all about al_play_audio_stream(3). no date is listed on this one, so Iβm not making one up π«Άπ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms