This project has moved. For the latest updates, please go here.

NAudio.MmException (Mp3FileReader)

Sep 20, 2014 at 3:35 PM
Edited Sep 22, 2014 at 11:29 PM
Hi,

I wrote an app that plays an MP3:
       var reader = new Mp3FileReader(audioPath + SelectedTrack1);
       var waveOut1 = new WaveOut();
       waveOut1.Init(reader);
       waveOut1.Play();
It works on Windows 8 and 8.1 perfectly.

However on Windows 7 x64 (1 out of 100 computers) will get this ERROR and crash. Unfortunately my users do not have Visual Studio installed and I have no way of troubleshooting because all three of my machines work just fine.

The app requires .NET 4.5 - all the users have it.

_Application: myapp_main.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: NAudio.MmException Stack:

at NAudio.Wave.AcmMp3FrameDecompressor..ctor(NAudio.Wave.WaveFormat)
at NAudio.Wave.Mp3FileReader.CreateAcmFrameDecompressor(NAudio.Wave.WaveFormat)
at NAudio.Wave.Mp3FileReader..ctor(System.IO.Stream, FrameDecompressorBuilder)
at NAudio.Wave.Mp3FileReader..ctor(System.IO.Stream)
at NAudio.Wave.Mp3FileReader..ctor(System.String)
at #cab.#nT.#yY()
at #cab.#nT.#Nab(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.ThreadPoolWaitCallback.PerformWaitCallback()



Faulting application name: myapp_main.exe, version: 1.0.0.0, time stamp: 0x541bb643
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18409, time stamp: 0x53159a86
Exception code: 0xe0434352
Fault offset: 0x0000c42d
Faulting process id: 0x1d80
Faulting application start time: 0x01cfd4dcc389bdbe
Faulting application path: C:\Program Files (x86)\myapp\myapp_main.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: 11164c48-40d0-11e4-b010-d43d7ef3f05c


I would appreciate any guidance on this. Why is this code crashing!? HELP!!!

Thank you,

Anthony
Jan 23, 2015 at 1:33 AM
Hi, Did you get this error resolved???
We are facing the same issue now... :-)
Jan 27, 2015 at 2:06 PM
Hi!

I changed:
var reader = new Mp3FileReader(audioPath + SelectedTrack);
To this:
var reader = new Mp3FileReader(audioPath + SelectedTrack, wave => new DmoMp3FrameDecompressor(wave));
Found it after hours of reading the NAudio documentation. This has solved my problem above.

Good luck!

Anthony
Marked as answer by afsanchez001 on 1/27/2015 at 7:07 AM
Coordinator
Feb 7, 2015 at 1:26 PM
Great, glad you found the solution. You also probably could have used MediaFoundationReader as well.