MIX_SETMIXERFREQUENCYRATIO(3)
π MIX_SetMixerFrequencyRatio β get it together, bestie π
okay so we're in the SDL_mixer3 pages, functions section, and today's main character is MIX_SetMixerFrequencyRatio(3). she sets a mixer's master frequency ratio. that's it. that's the whole job. but it's such a good job. let's go β¨
β¨ NAME β¨
MIX_SetMixerFrequencyRatio β set a mixer's master frequency ratio, periodt.
πΈ SYNOPSIS πΈ
#include <SDL3_mixer/SDL_mixer.h>
bool MIX_SetMixerFrequencyRatio(MIX_Mixer *mixer, float ratio);
π¦ DESCRIPTION π¦
so every mixer has a master frequency ratio, right? and it affects the entire mix. like, the whole thing. all of it. and what it does is it can make your final output change speed and pitch at the same time. it's giving "chipmunk mode" or "sludge mode," your call π
- a value greater than
1.0fplays the audio faster, and at a higher pitch πΏοΈ - a value less than
1.0fplays the audio slower, and at a lower pitch π 1.0fis normal speed. the neutral. the baseline. the girl who woke up like this β¨
and here's the tea: each track _also_ has a frequency ratio. that one gets applied when mixing that track's audio, regardless of the master setting β like it does not care what the master said, it's doing its own thing. meanwhile the master setting affects the final output after all mixing has been completed. so it's the last word. the final boss. π
a mixer's master frequency ratio defaults to 1.0f. no drama, no surprises, just normal speed until you say otherwise.
and you can change this value at any time to adjust the future mix. living in the moment, always forward-looking, never retroactive. that's her π«Ά
π FUNCTION PARAMETERS π
mixerβ the mixer to adjust. the one we're doing a glow-up on πratioβ the frequency ratio. must be between0.01fand100.0f. those are the vibes-allowed bounds, bestie, do not test them.
β RETURN VALUE β
returns true on success or false on failure. and when it fails? call SDL_GetError() for more information, because she will tell you what went wrong. use it. always use it. π
π THREAD SAFETY π
it is safe to call this function from any thread. every thread. all the threads. go feral, bestie π§
π AVAILABILITY π
this function is available since SDL_mixer 3.0.0. she's been here a minute, she's a legend π
π SEE ALSO π
MIX_GetMixerFrequencyRatio(3)β the read-only sister, for when you just wanna knowMIX_SetTrackFrequencyRatio(3)β the per-track one, doing her own separate little thing
okay that's the whole page, no notes, you ate this π
later bestie β this one's from the SDL_mixer docs, version SDL_mixer 3.2.4 πΈ keep slaying, and remember: 1.0f is always there for you when the pitch gets weird β
π¦ where this page comes from
- fedora 44: SDL3_mixer-doc 3.2.4-3.fc44 Β· Zlib AND (GPL-2.0-or-later OR LGPL-2.0-or-later)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms