MIX_GETTRACKFREQUENCYRATIO(3)

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

πŸ’– MIX_GetTrackFrequencyRatio(3) πŸ’–

okay bestie so this is a page from SDL_mixer3 FUNCTIONS and we're talking about MIX_GetTrackFrequencyRatio β€” the little guy that tells you how fast a track is vibing ✨


🌸 NAME 🌸

MIX_GetTrackFrequencyRatio β€” asks a track what its frequency ratio is, like a vibe check but for playback speed πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3_mixer/SDL_mixer.h>

float MIX_GetTrackFrequencyRatio(MIX_Track *track);

πŸ¦‹ DESCRIPTION πŸ¦‹

So the frequency ratio is literally the thing that controls how fast the audio data gets eaten up. Change it and you're changing the speed and the pitch of the track's audio at the same time β€” yes, they come as a package deal, no splitting them up πŸ™ˆ

  • Anything greater than 1.0f plays the audio faster, and at a higher pitch β€” it's giving chipmunk era, honestly iconic.
  • Anything less than 1.0f plays it slower, at a lower pitch β€” slow-mo main character moment.
  • 1.0f is normal speed. The default. The baseline. The unbothered queen πŸ‘‘

The default value is 1.0f.

Now the messy part: on various errors β€” like MIX_Init() was not called, or the track is NULL β€” this returns 0.0f. And since 0.0f is not a valid value to set, you can read that as an error state. Like if you get 0.0f back, something went wrong, periodt πŸ’€


πŸ‘‘ FUNCTION PARAMETERS πŸ‘‘

  • track β€” the track you're querying the frequency ratio of. the one we're interrogating πŸ’–

⭐ RETURN VALUE ⭐

Returns the current frequency ratio, or 0.0f on failure. And if it failed? Call SDL_GetError() for more info, bestie, she'll tell you what happened 🫢


🌈 THREAD SAFETY 🌈

It is safe to call this function from any thread. any of them. go wild ✨


πŸ’œ AVAILABILITY πŸ’œ

This function is available since SDL_mixer 3.0.0.


🌟 SEE ALSO 🌟


and that's the whole page, no cap πŸ§šπŸ’– written up from SDL_mixer version 3.2.4 β€” stay slaying out there, and remember: if you got a 0.0f, check SDL_GetError(), she always knows what's up πŸŽ€πŸ’…

πŸ“¦ where this page comes from