I am working with some large mp3 sound files. Ranging from a few hours to 15+ hours. I need to convert these mp3 files into wav. Due to the size of the files it is not possible to load a whole file and then convert it.
My solution so far is using NAudio and NAudio.Lame I have modified: Mp3FileReader and Mp3FrameDecompressor to my needs. And this works, I can load in 100 mb chucks at a time and convert it. Due to my implementation I can load a Mp3 fils where each frame in the same mp3 file varies slightly (1 frame is mono and another is stereo in the same file).
This is all good.
My problem is the timing between the original mp3 and the generated wav. An example is a 9 hours 34 minutes and 38 seconds mp3 file, generated to a wav file is only 9 hours 21 minutes and 15 seconds long.
That is a lose of 13 minutes and 23 seconds, 3.7% shorter!. But I can not find anything which is lost in the audio. Everything seems to be there, it is just, shorter. Like the audio is played 3.7% faster than the mp3. It is a problem for me, because I need to be able to make a mapping between the wav and mp3 at a later date, and I would greatly prefer the mapping is 1 to 1.
I have tried to import the Mp3 file into Audacity with the same result, the imported audio in Audacity is again 13 minutes shorter than the original mp3 file.
This leads me to think the problem is not my code alone, is there an explanation to this behavior?
I have passed the MP3 files through mp3val and the problem appears to be, not NAudio and NAudio.Lame, but the MP3 file itself.
The MP3 file contain errors!
The fix is then to make sure the MP3 files does not contain errors.