Closed d3pendent closed 4 years ago
Will check it in few days.
Sorry for late response. Can you provide example mp3 showing issues?
Now it is me who took so long to respond :) Sorry about that. I am attaching a zip file with two mp3 files. They are quite large. One of them leads to an exception when parsing and the other ones calculated time is off by 8 seconds. I named the files to the testcase so you will see which one is which. I hope it helps in any ways. If not I can provide more data.
Thank you for checking it out. mp3_to_test.zip
Hi, is there any way I can assist you on this?
I've looked that and could not fix it at that moment. It requires more time and attention. If you can, I'd ask for assistance. First of all, we need to understand which parts of mp3 decoded successfuly and which not.
oh wow. I have looked into this and it is quite advanced. I need to understand the frames and sections of the mp3 stream first to be able to figure out what's wrong. I didn't think this would be so complex.
Found a problem and fixed
Hi, first I wan to say great work! It is blasting fast. Very impressive! I just figured out that the duration you calculate is off by about 0.5% depending on the actual size. On a 30 min audio file it is about 8-9 seconds off. I have no clue how that whole calculation is done, otherwise I would fix it and create a PR.
Some files couldn't even be read because it did not find the header.
I compared the parsed time with this class: http://www.zedwood.com/article/php-calculate-duration-of-mp3 this one is mostly correct (sometime off by one second) but it is 662x slower than yours. ;) Maybe it helps you.