I am using this section of code in my C# program which I found on this stackoverflow thread.
using (WaveFileReader reader = new WaveFileReader("myfile.wav"))
{
Assert.AreEqual(16, reader.WaveFormat.BitsPerSample, "Only works with 16 bit audio");
byte[] buffer = new byte[reader.Length];
int read = reader.Read(buffer, 0, buffer.Length);
short[] sampleBuffer = new short[read / 2];
Buffer.BlockCopy(buffer, 0, sampleBuffer, 0, read);
}
The code uses NAudio, so I have referenced the libary and added using NAudio.Wave;
but I am receiving the error: The name 'Assert' does not exist in the current context.
How can i fix this?
This may have been better as a comment but I do not have enough reputation to do so