MIX_AudioMSToFrames(3)
π MIX_AudioMSToFrames(3) π
okay bestie, welcome to the SDL_mixer3 FUNCTIONS section of the manual, and today's main character is MIX_AudioMSToFrames. yes she's a libc-style function, yes she has a <SDL3_mixer/SDL_mixer.h> include, and yes she ate. let's get into it π«Ά
β¨ NAME β¨
MIX_AudioMSToFrames β literally converts milliseconds into sample frames for a MIX_Audio's format. that's the whole job. she does one thing and she does it flawlessly π
πΈ SYNOPSIS πΈ
#include <SDL3_mixer/SDL_mixer.h>
Sint64 MIX_AudioMSToFrames(MIX_Audio *audio, Sint64 ms);
π¦ DESCRIPTION π¦
so the way this works is: it calculates the time based on the audio's initial format, even if the format would change mid-stream. like, she's not out here second-guessing herself β she locked in on the original format and she's standing on business β¨
and ngl, there's a lil catch: if ms is < 0, this returns -1. periodt. that's the boundary, no negotiating π
π FUNCTION PARAMETERS π
audioβ the audio to query. the vibe check source, if you will.msβ the milliseconds to convert to audio-specific sample frames. aka the raw number you're handing over to get translated π
β RETURN VALUE β
returns the converted number of sample frames, or -1 for errors/no input. and if you get that -1? call SDL_GetError() for details, bestie, she'll tell you what went wrong π₯
π THREAD SAFETY π
it is safe to call this function from any thread. iconic. no drama, no locking stress, just vibes π
π AVAILABILITY π
this function is available since SDL_mixer 3.0.0. she's been here, she's established, she's a queen π
π SEE ALSO π
MIX_AudioFramesToMS(3)β the reverse direction, her partner in crime π«Ά
and that's the whole page, no cap. mwah π
sending you off with the receipts: this is from SDL_mixer, version 3.2.4, and the page is MIX_AudioMSToFrames(3) β go convert some milliseconds, you got this πβ¨π
π¦ where this page comes from
- fedora 44: SDL3_mixer-doc 3.2.4-3.fc44 Β· Zlib AND (GPL-2.0-or-later OR LGPL-2.0-or-later)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms