[BUG] Wrong duration using TinyTag.get
I get a wrong duration with TinyTag.get(myMP3path)
To Reproduce under mac or centos 8, tinytag==1.10.1, python 3.11 or 3.12
Expected behavior The returned duration is 1.176 instead of 4.65
Sample File test1.zip
Also getting this error on version 2.0.0 224acb1, using python 3.10.10
In addition to wrong duration, sometimes I get values that are too large and even negative! For example: -46332413.64897959 and 36934167.48408163 seconds. The files have no problem and the durations are calculated correctly with Librosa.
In addition to wrong duration, sometimes I get values that are too large and even negative! For example: -46332413.64897959 and 36934167.48408163 seconds. The files have no problem and the durations are calculated correctly with Librosa.
Please attach a sample file.
In addition to wrong duration, sometimes I get values that are too large and even negative! For example: -46332413.64897959 and 36934167.48408163 seconds. The files have no problem and the durations are calculated correctly with Librosa.
Please attach a sample file.
tinytag.TinyTag.get('52a6r.mp3').duration --> 47583839.895510204
librosa.get_duration('52a6r.mp3') --> 2632.2140589569162
$ soxi 52a6r.mp3
Input File : '52a6r.mp3'
Channels : 1
Sample Rate : 44100
Precision : 16-bit
Duration : 00:43:52.25 = 116082401 samples = 197419 CDDA sectors
File Size : 21.1M
Bit Rate : 64.0k
Sample Encoding: MPEG audio (layer I, II or III)
Should be fixed now. Please try the master branch and see if you still have files that tinytag can't parse properly.
Something's not quite right with the sample file in the original post. Other libraries estimate a duration anywhere from 3 to 5 seconds. tinytag currently reports a duration of 4 seconds, which is close enough in my opinion.