MIX_FramesToMS - Man Page

Convert sample frames, at a specific sample rate, to milliseconds.

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

MIX_MSToFrames(3)

Info

SDL_mixer 3.2.4 SDL_mixer3 FUNCTIONS