table of contents
- experimental 3.1~git20250910~d032535+ds-1
MIX_FramesToMS(3) | SDL_mixer3 FUNCTIONS | MIX_FramesToMS(3) |
NAME¶
MIX_FramesToMS - Convert sample frames, at a specific sample rate, to milliseconds.
HEADER FILE¶
Defined in SDL3_mixer/SDL_mixer.h
SYNOPSIS¶
#include "SDL3_mixer/SDL_mixer.h"
Sint64 MIX_FramesToMS(int sample_rate, Sint64 frames);
DESCRIPTION¶
Sample frames are more precise than milliseconds, so out of necessity, this function will approximate by rounding down to the closest full millisecond.
If sample_rate is <= 0, this returns -1. If frames is < 0, this returns -1.
FUNCTION PARAMETERS¶
- sample_rate
- the sample rate to use for conversion.
- frames
- the rate-specific sample frames to convert to milliseconds.
RETURN VALUE¶
Returns Converted number of milliseconds, or -1 for errors; 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¶
•(3), MIX_MSToFrames(3)
SDL_mixer 3.1.0 | SDL_mixer |