set_hardware_volume(3alleg4)
π set_hardware_volume β bestie, let's talk about the ACTUAL speakers π
okay so real talk: this is a page from the Allegro manual (that's 3alleg4, the Allegro game programming library, mwah π). And set_hardware_volume does exactly what it says on the tin β it alters the hardware sound output volume. Not a vibe, not a metaphor. The literal, physical, whole-computer volume. β¨
π SYNOPSIS π
#include <allegro.h>
void set_hardware_volume(int digi_volume, int midi_volume);
that's it. that's the whole signature. two ints and a dream π«Ά
πΈ DESCRIPTION πΈ
So like. set_hardware_volume alters the hardware sound output volume. And the way it works is that you specify volumes for both digital samples and MIDI playback β both of them, no picking favourites β as integers from 0 to 255.
The deets, fr fr:
digi_volumeis the volume for digital samples πΏmidi_volumeis the volume for MIDI playback πΉ- Both go from
0to255. That's the range. Respect it. - Wanna leave one of them alone? Pass a negative value and that setting stays exactly how it was. No touchy. π
- Feeling spicy and passing something bigger than
255? Cute. It gets reduced to255. The cap is the cap, bestie. π
β οΈ THE BIG ONE, PAY ATTENTION: this routine uses the hardware mixer to control the volume if it exists. And if it exists, that means the volume of ALL the applications on your machine will be affected. Not just yours. Not just the game. Everyone's. You are grabbing the global knob, no cap. ποΈ
And if there's no hardware mixer? Then it just... does nothing. Iconic behaviour honestly, it just stands there π
π SEE ALSO π
π later, bestie π
This was the Allegro manual, version 4.4.3, page set_hardware_volume(3alleg4). Go forth, control the volume of every app on your machine, and be normal about it (you won't be, and that's valid π). mwah! πβ¨π¦
π¦ 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