Alexander Mashin
Alexander Mashin

Reputation: 711

Microphone buffer in NAudio C#

I set sample rate on microphone(NAudio.WaveIn) 44100Hz. But when I use WaveInDataAvailible(object sender, WaveInEventArgs e). In e.Buffer I have 4410, instead of 44100 elements. Why this take me 10 times less measurement?

Upvotes: 1

Views: 1828

Answers (1)

Mark Heath
Mark Heath

Reputation: 49522

That's because your buffer size is 50ms. Each buffer contains 2205 samples, and because they are 16 bits (2 bytes) each, there are 4410 bytes in your buffer.

Upvotes: 5

Related Questions