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


WaveFileReader.TryReadFloat does not consider channel count


in WaveFileReader.TryReadFloat data is read by Read(value, 0, x), with x, for example, =2 for 16 bits per sample.
However, if the wav file is multichannel, say 6 channels, each sample has 12 bytes. So the Read method throws an exception "Must read complete blocks".


talbengal wrote Nov 15, 2011 at 10:57 AM

I am having the same problem.
Is this fix?
Did you find a solution to this?

markheath wrote Jan 9, 2013 at 10:48 AM

This will be fixed in NAudio 1.7 with a new method called ReadSampleFrame. This will return an array of floats, one per channel, or null at end of file. I've marked TryReadFloat as Obsolete.