-1

I would like to ask: "how to manipulate the microphone(laptop embedded microphone) using NAudio API?"

i don't like to record the sound that comes from the mic but measure it in terms of dB.

its like a faucet of water open and placing it through a water filter extracting every dirt(data) that comes along with the water.

Thank You.

Notes: Programming Language = C#. Programming Knowledge = UnderGrad

mikepicart
  • 17
  • 1
  • 2

1 Answers1

0

If you are using NAudio, you will get the recorded data back as a byte array in the DataAvailable event. Assuming that you are recording at 16 bit, then you would take every two bytes and convert that to a short (Int16) using either the BitConverter class or doing your own bit manipulation.

This gives you sample values that you can process as you wish. To get a dB value you would then divide the absolute value of the sample by 32768, take its log (base 10) and then multiply by 20.

Mark Heath
  • 48,273
  • 29
  • 137
  • 194