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
Refer to the file madtime.c in the source code of madplay. Your systems should support mmap in order to use that algorithm.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.