al_set_sample_instance_gain(3alleg5)
π al_set_sample_instance_gain β Allegro 5 API π
okay bestie, welcome to the allegro5 manual, the section for the al_set_sample_instance_gain function. yes this is the glow-up your sample instance has been waiting for β¨
β¨ NAME β¨
al_set_sample_instance_gain β the Allegro 5 API function that sets a sample instance's playback gain, no cap π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro_audio.h>
bool al_set_sample_instance_gain(ALLEGRO_SAMPLE_INSTANCE *spl, float val)
like. look at her. iconic signature fr fr π
π¦ DESCRIPTION π¦
so what does she even do?? she sets the playback gain of the sample instance. that's it, that's the whole vibe. the spl is your sample instance and val is the gain you're giving her. slay.
she returns true on success and false on failure β so always check the return value, bestie, don't just assume it ate π
β οΈ and heads up: she will fail if the sample instance is attached directly to a voice. like, not a vibe, not negotiable, it just won't work. if that's your setup you're gonna get false back and you're gonna have to deal with it π
π SEE ALSO π
al_get_sample_instance_gain(3alleg5)β the little sister function that reads the gain back out, go say hi π«Ά
and that's the whole page, periodt π this came to you straight from the Allegro reference manual β the al_set_sample_instance_gain(3alleg5) page, so you know the source. no date on this one, she's timeless like that βπ
π¦ 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