Just starting out with NAudio, but very hopeful it will make my coding life easier once I get past this issue.
I'm working on a WPF application (.net framework 4.5) that just needs to play any given MP3 file.
I'm using the following code pulled from a StackOverflow example (but I've also tried different variations, all with the same result):
using (var ms = File.OpenRead(audioFilePath))
using (var rdr = new Mp3FileReader(ms)) // exception is thrown here
using (var wavStream = WaveFormatConversionStream.CreatePcmStream(rdr))
using (var baStream = new BlockAlignReductionStream(wavStream))
using (var waveOut = new WaveOut(WaveCallbackInfo.FunctionCallback()))
while (waveOut.PlaybackState == PlaybackState.Playing)
When the Mp3FileReader constructor is called, I get the ArgumentOutOfRangeException and "Non-negative number required" message.
Any suggestions are appreciated, and please let me know if more information is required.