set_volume(3alleg4)
β¨ set_volume β¨
okay bestie, you found it β the set_volume page from the Allegro manual (that's section 3alleg4 btw, Allegro game programming library, we love her π). It does exactly one thing and it does it iconically: it messes with how loud your sound is. Globally. Periodt.
π NAME π
set_volume β alters the global sound output volume. Allegro game programming library. that's the whole vibe, no notes π
πΈ SYNOPSIS πΈ
#include <allegro.h>
void set_volume(int digi_volume, int midi_volume);
π¦ DESCRIPTION π¦
So like, this function alters the global sound output volume. That's it. That's the job. π
You're passing in volumes for both digital samples and MIDI playback β yes, both, she's an overachiever. They're integers from 0 to 255. That's the range. Live within it. π
And listen, the fun part:
- pass a negative value and it leaves one of the settings unchanged β so if you only wanna touch the digi volume, you can just vibe-check the MIDI one by yeeting a negative in there π
- values bigger than 255 get reduced to 255. not an error, not a crash, she just caps you. humble behavior honestly π
β οΈ real talk though β this routine will not alter the volume of the hardware mixer if it exists. i.e. only your application will be affected. so don't go thinking you're turning down the whole machine, bestie, because you are NOT. it's giving main character energy for your app only. π
β SEE ALSO β
install_sound(3alleg4)β go set up your sound first, babe π«Άset_hardware_volume(3alleg4)β for when you actually DO wanna touch the hardware mixer π
and that's the whole page, slay π β¨
this little icon dropped in Allegro version 4.4.3, set_volume(3alleg4), and she's been serving ever since. no cap. go make some noise ππ¦π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms