.\" This manpage content is licensed under Creative Commons
.\"  Attribution 4.0 International (CC BY 4.0)
.\"   https://creativecommons.org/licenses/by/4.0/
.\" This manpage was generated from SDL_mixer's wiki page for MIX_TrackFramesToMS:
.\"   https://wiki.libsdl.org/SDL3_mixer/MIX_TrackFramesToMS
.\" Generated with SDL/build-scripts/wikiheaders.pl
.\"  revision 3.2.0+ds-1
.\" Please report issues in this manpage's content at:
.\"   https://github.com/libsdl-org/sdlwiki/issues/new
.\" Please report issues in the generation of this manpage from the wiki at:
.\"   https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20MIX_TrackFramesToMS
.\" SDL_mixer can be found at https://libsdl.org/projects/SDL_mixer/
.de URL
\$2 \(laURL: \$1 \(ra\$3
..
.if \n[.g] .mso www.tmac
.TH MIX_TrackFramesToMS 3 "SDL_mixer 3.2.0" "SDL_mixer" "SDL_mixer3 FUNCTIONS"
.SH NAME
MIX_TrackFramesToMS \- Convert sample frames for a track\(aqs current format to milliseconds\[char46]
.SH SYNOPSIS
.nf
.B #include <SDL3_mixer/SDL_mixer.h>
.PP
.BI "Sint64 MIX_TrackFramesToMS(MIX_Track *track, Sint64 frames);
.fi
.SH DESCRIPTION
This calculates time based on the track\(aqs current input format, which can change when its input does, and also if that input changes formats mid-stream (for example, if decoding a file that is two MP3s concatenated together)\[char46]
.PP
Sample frames are more precise than milliseconds, so out of necessity, this function will approximate by rounding down to the closest full millisecond\[char46]
.PP
On various errors
.BR "" ( MIX_Init ()
was not called, the track is NULL), this returns -1\[char46] If the track has no input, this returns -1\[char46] If
.BR frames
is < 0, this returns -1\[char46]

.SH FUNCTION PARAMETERS
.TP
.I track
the track to query\[char46]
.TP
.I frames
the track-specific sample frames to convert to milliseconds\[char46]
.SH RETURN VALUE
Returns Converted number of milliseconds, or -1 for errors/no input; call SDL_GetError() for details\[char46]

.SH THREAD SAFETY
It is safe to call this function from any thread\[char46]

.SH AVAILABILITY
This function is available since SDL_mixer 3\[char46]0\[char46]0\[char46]

.SH SEE ALSO
.BR MIX_TrackMSToFrames (3)
