-
Notifications
You must be signed in to change notification settings - Fork 50
Some suggestions regarding Nihlus #27
Description
I used Visual Studio to load MP3Sharp via NuGet and it grabbed the Nihlus version. There is no way to add an issue to that project, so here ya go. I see there is a "Mono" version from Nihlus, so I will quickly say that mono files play at half speed with the NuGet version from Nihlus and the NuGet version of NAudio, and I worked around that by doubling the sample rate when creating an NAudio WaveFormat object. I am not sure if this is a problem with MP3Sharp or NAudio.
I sometimes see IndexOutOfRangeException. This is resolved by adding an extra 16th element for arrays TableFactor and TableOffset in Decoding\Decoders\LayerI\SubbandLayer1.cs. If I open and export the problematic MP3 file with Audacity, the error is fixed without the change to SubbandLayer1.
I sometimes see NullRefenceException. This is partly fixed by adding a call to InitBlock() in method prepare_sample_reading in file Decoding\Decoders\LayerII\SubbandLayer2.cs. After that, I still sometimes get the error, so maybe there are additional places to change. If I open and export the problematic MP3 file with Audacity, the error is fixed without the change to SubbandLayer2.
The Nihlus version has a bunch of calls to Trace.WriteLine or Console.WriteLine. These can cause bad performance in certain MP3 files that have a lot of unusual blocks. My recommendation is to add a "Release" configuration with the WriteLines excluded. Usually, Audacity does not fix these issues, but for "invalid version detected", exporting with Audacity does fix that.