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

Close

Calculating total playback time

2006-01-30
2013-04-24
  • 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.

      Regards,
      Amraldo.