mixSetTrackFrequencyRatio function mixer
Change the frequency ratio of a track.
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.
\param track the track on which to change the frequency ratio. \param ratio the frequency ratio. Must be between 0.01f and 100.0f. \returns true on success or false on failure; call SDL_GetError() for more information.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL_mixer 3.0.0.
\sa MIX_GetTrackFrequencyRatio
extern SDL_DECLSPEC bool SDLCALL MIX_SetTrackFrequencyRatio(MIX_Track *track, float ratio)
Implementation
bool mixSetTrackFrequencyRatio(Pointer<MixTrack> track, double ratio) {
final mixSetTrackFrequencyRatioLookupFunction = _libMixer
.lookupFunction<
Uint8 Function(Pointer<MixTrack> track, Float ratio),
int Function(Pointer<MixTrack> track, double ratio)
>('MIX_SetTrackFrequencyRatio');
return mixSetTrackFrequencyRatioLookupFunction(track, ratio) == 1;
}