al_set_audio_stream_fragment(3alleg5)

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

✨ al_set_audio_stream_fragment β€” Allegro 5 API ✨

okay bestie, welcome to the Allegro reference manual (yes, the Allegro reference manual, Allegro 5 era, the whole vibe) πŸ’– this one's a little one but she's IMPORTANT, so lock in.


🌸 NAME 🌸

al_set_audio_stream_fragment β€” it's the Allegro 5 API function that tells your audio stream "hey girl, the buffer's ready" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro5/allegro_audio.h>

bool al_set_audio_stream_fragment(ALLEGRO_AUDIO_STREAM *stream, void *val)

look at her. two params, one bool return, no drama. iconic ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea, and it's literally the whole function:

You call al_set_audio_stream_fragment for every single successful call of al_get_audio_stream_fragment(3alleg5). Every. One. No skipping, no "I'll do it later", no "it's fine" πŸ™ˆ

Why tho? Because calling it is how you indicate that the buffer β€” the one pointed to by val β€” is filled with new data. That's the message you're sending back. The get gave you a buffer, you filled it, and this is you going "done bestie, it's got fresh data in it now" 🫢

no cap: the "for every successful call" part is not a suggestion. The way that the get and the set are a matched set? That's the whole mechanic. Miss one and you've left the buffer situation un-announced, and that's on you πŸ’€

πŸ”₯ SEE ALSO πŸ”₯


and that's the page!! 🌈 source is the Allegro reference manual, version Allegro 5 (you can tell from the 3alleg5 hanging off the name, iykyk), and as for the date… girl, the footer didn't give us one, so I'm not making one up β€” I don't invent facts, that's not the vibe ⭐ anyway ily, go fill your buffers, mwah πŸ’œ

πŸ“¦ where this page comes from