Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue converting MP3 to Wav files. #24

Open
richardlatterPBA opened this issue Apr 16, 2021 · 0 comments
Open

Issue converting MP3 to Wav files. #24

richardlatterPBA opened this issue Apr 16, 2021 · 0 comments

Comments

@richardlatterPBA
Copy link

richardlatterPBA commented Apr 16, 2021

Hello All,
I have an issue with converting from MP3 to Wav files using NLayer. There appears to be an anomaly when creating the .wav file. Let me explain.
Steps.

  1. Using Audacity, I create a tone waveform to 10 minutes and save this as .mp3 file (Tone-10m.mp3).

  2. Using the following code (see below), I convert this to a .wav file (Tone-10m-to-wave.wav).

` static void Main(string[] args)
{

        // set up source and target files
        var sourceFile = Path.Combine("C:\\tmp", "Tone-1m.mp3");
        var targetFile = Path.Combine("C:\\tmp", "Tone-1m-to-wave.wav");

        // create the builder
        var builder = new Mp3FileReaderBase.FrameDecompressorBuilder(wf => new Mp3FrameDecompressor(wf));

        // write the wav file
        using (var reader = new Mp3FileReaderBase(sourceFile, builder))
        {
            WaveFileWriter.CreateWaveFile(targetFile, reader);
        }

        Console.WriteLine("Done!");

    }`
  1. Comparing the two, waveforms in Audacity, I can see at 1.38m, 5.12m and at 8.46m there are spikes in the waveform. See original .mp3 and processed.wav files below.

  2. Processing other more musical waveforms, I cannot see any other anomalies. This seems to be just on this, but I’m wondering if there is a bug in the code somewhere.

Has anyone else experienced this?

tempsnip

Mp3ToWavConversion.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant