I am very new to NAudio and I need to convert the buffer of input samples from an input device to an array of doubles that range from -1 to 1.
I create the input device as follows:
WaveIn inputDevice = new WaveIn();
//change the input device to the one i want to receive audio from
inputDevice.DeviceNumber = 1;
//change the wave format to what i want it to be.
inputDevice.WaveFormat = new WaveFormat(24000, 16, 2);
//set up the event handlers
inputDevice.DataAvailable +=
new EventHandler(inputDevice_DataAvailable);
inputDevice.RecordingStopped +=
new EventHandler(inputDevice_RecordingStopped);
//start the device recording
inputDevice.StartRecording();
Now when the 'inputDevice_DataAvailable' callback gets called I get a buffer of audio data. I need to convert this data to and array of doubles that represent volume levels between -1 and 1. If anyone can help me out that would be great.