MIX_SETMIXERFREQUENCYRATIO(3)

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

πŸ’– 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.0f plays the audio faster, and at a higher pitch 🐿️
  • a value less than 1.0f plays the audio slower, and at a lower pitch 🐌
  • 1.0f is 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 between 0.01f and 100.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 πŸ‘‘


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