Problem Solved
I solve problems for a living. It is the point of overcoming a difficult problem that gives me the most joy. I was trying to read MP3 files with a script so that I could determine the length of the audio playtime in seconds. I just broke through and got it to work.
So now comes the fun part. I get to clean up the code. I also have plenty of time to reflect why I didn’t catch on earlier. As the saying goes, “Hindsight is always 20/20″. All documentation over the MPEG format does not cover what to do in the case of ID3v2 tags. ID3v2 was added as meta data after MPEG became a standard, so it is no wonder why there isn’t any mention of it.
The answer was simple. If an MPEG audio file has the string “ID3″ as the first three characters in the file, then you just read the header to find out how large the ID3 tag is and skip past it. Once I did that, everything worked perfectly.
One benefit to solving this problem is that my code started to become optimized. I separated portions into smaller methods so that I could manage things easier and see the big picture. I even learned many ways to do the same thing. I’m still a little new to the PHP programming language, so this was a great exercise.
November 27th, 2005 at 1:56 am
Damn, you are way smart… I’m just going to nod and smile, and pretend I understand what all that meant. GO LEWIE!
November 27th, 2005 at 1:59 am
It just means that I can read much of the information stored within an MP3 audio file.