MIX_SetTrackFrequencyRatio(3)

NAME
MIX_SetTrackFrequencyRatio - Change the frequency ratio of a track.

SYNOPSIS
#include <SDL3_mixer/SDL_mixer.h>

bool MIX_SetTrackFrequencyRatio(MIX_Track *track, float ratio);

DESCRIPTION
The frequency ratio is used to adjust the rate at which audio data is consumed. Changing this effectively modifies the speed and pitch of the track's audio. A value greater than 1.0f will play the audio faster, and at a higher pitch. A value less than 1.0f will play the audio slower, and at a lower pitch. 1.0f is normal speed.

The default value is 1.0f.

This value can be changed at any time to adjust the future mix.

FUNCTION PARAMETERS

track
    the track on which to change the frequency ratio.

ratio
    the frequency ratio. Must be between 0.01f and 100.0f.

RETURN VALUE
Returns true on success or false on failure; call SDL_GetError() for more information.

THREAD SAFETY
It is safe to call this function from any thread.

AVAILABILITY
This function is available since SDL_mixer 3.0.0.

SEE ALSO
MIX_GetTrackFrequencyRatio(3)