Mar 21, 2013 at 8:11 AM
Edited Mar 21, 2013 at 8:12 AM
I am capturing soung from the microphone and willing to have it sampled as IEEE float
I think the right way to do it is, isn't it ?
waveIn = new WaveIn();
waveIn.DataAvailable += waveIn_DataAvailable;
int sampleRate = 44100; // 44,1 kHz
int channels = 2; // stereo
waveIn.WaveFormat = WaveFormat.CreateIeeeFloatWaveFormat(sampleRate, channels);
What makes me confused is that I was expecting to receive a float array in the callback
void waveIn_DataAvailable(object sender, WaveInEventArgs e)
audioBuffer = e.Buffer;
And I get a cast exception. It seems that e.Buffer is a Byte array... So how to move from this byte array to a float array ?