[sdlsound] Easy way to know the total time and the current time ?

Ryan C. Gordon icculus at clutteredmind.org
Sat Jul 20 07:23:35 EDT 2002


>   Is there any way to know the total time of a song from a file
>   and the current playing time ?
>   I think I can use SDL_RWRead and SDL_RWSeek to know
>   the total size and current position of a file.
>   How to know that in the unit of time ?
>   It would be tricky to map from size to time unit.

It would depend on things that we can't guarantee:

1) That the rwops can successfully seek().
2) That a given format knows ahead of time how long the final output will be.

--ryan.






More information about the sdlsound mailing list