MIX_SetMixerGain(3)

πŸ“¦
version 3.2.4 Β· 2 versions
, in fedora 44

✨ MIX_SetMixerGain(3) ✨

okay bestie, welcome to the SDL_mixer3 FUNCTIONS corner of the universe, where we're talking about MIX_SetMixerGain β€” the girl who controls the master volume of your whole entire mix πŸ’…


🌸 NAME 🌸

MIX_SetMixerGain β€” sets a mixer's master gain control, no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3_mixer/SDL_mixer.h>

bool MIX_SetMixerGain(MIX_Mixer *mixer, float gain);

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, every mixer has a master gain, right? It's the big boss knob that adjusts the volume of the entire mix. Every single sample that passes through the pipeline gets modulated by this gain value. it's giving overseer energy πŸ‘‘

Here's the vibe check on the numbers:

  • a gain of zero will generate silence 🀫
  • 1.0f will not change the mixed volume (neutral queen, we stan)
  • anything larger than 1.0f will increase the volume πŸ”₯
🚨 Negative values are illegal. Do not. Like, don't even try it. 🚨

There is no maximum gain specified, but bestie… this can quickly get extremely loud. So please, please be careful with this setting. Your ears, your speakers, your neighbors β€” all of them are counting on you πŸ™ˆ

A mixer's master gain defaults to 1.0f. That's the starting point, that's the home base, that's the default era ✨

And the best part? This value can be changed at any time to adjust the future mix. Lowkey iconic behavior honestly. Live mixing, live vibes, periodt πŸ’–


πŸ“ FUNCTION PARAMETERS πŸ“

  • mixer β€” the mixer to adjust. That's the one getting its glow-up.
  • gain β€” the new gain value. The new number, the new destiny 🌈

✨ RETURN VALUE ✨

Returns true on success or false on failure 🫢 and if it fails, call SDL_GetError() for more information β€” she'll spill the tea on what went wrong 😭


πŸ’œ THREAD SAFETY πŸ’œ

It is safe to call this function from any thread. Yes girl, any single one of them. Multithreaded and unbothered 🧚


⭐ AVAILABILITY ⭐

This function is available since SDL_mixer 3.0.0. She's been here. She's a legacy icon πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page bestie!! this was MIX_SetMixerGain from SDL_mixer, version SDL_mixer 3.2.4 πŸ’– tysm for reading, go forth and set your gain responsibly, and remember: no negative values, no maximum, no regrets (well… some regrets, if you crank it). slay responsibly πŸŽ€βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from