MIX_AudioFramesToMS - Man Page
Convert sample frames for a MIX_Audio's format to milliseconds.
Synopsis
#include <SDL3_mixer/SDL_mixer.h> Sint64 MIX_AudioFramesToMS(MIX_Audio *audio, Sint64 frames);
Description
This calculates time based on the audio's initial format, even if the format would change mid-stream.
Sample frames are more precise than milliseconds, so out of necessity, this function will approximate by rounding down to the closest full millisecond.
If frames is < 0, this returns -1.
Function Parameters
- audio
the audio to query.
- frames
the audio-specific sample frames to convert to milliseconds.
Return Value
Returns Converted number of milliseconds, or -1 for errors/no input; call SDL_GetError() for details.
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
Info
SDL_mixer 3.2.4 SDL_mixer3 FUNCTIONS