Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


Calculating total playback time

  • Hello,

    I wonder how to obtain the total playback time of a mp3 file.

    Reading all the mp3 headers within the frames and adding the duration? Therefore you have to read the whole mp3 file.

    Calculating the payback time by using mp3 filesize, bitrate per frame.

    filesize/Bitrate*26ms per frame = playback time

    Ciao, Michael

    • Refer to the file madtime.c in the source code of madplay. Your systems should support mmap in order to use that algorithm.