al_play_audio_stream(3)

πŸ“¦
version 5.2.11.3 Β· 2 versions
, in arch rolling

πŸ’– 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: the allegro_audio library does not support any audio file formats by default. You must use the allegro_acodec addon, 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