This project has moved and is read-only. For the latest updates, please go here.

Displaying Recording Volume

Dec 28, 2011 at 4:41 AM

First off, I am still learning how to use NAudio and don't know all the tricks yet.  I am recording from the microphone to a wav file.  Is there a way to display volume level as it is being recorded? Thank you for your help.

Dec 28, 2011 at 7:47 AM

an example of doing this can be found in the application.

The basic trick is to examine the values of the samples you get in the record buffer. if you are recording in 16 bit, every two bytes is one sample (can convert to Int16 with the BitConverter class). Then, for each recorded buffer, use the loudest sample to show the volume meter. Meters work best logarithmic, so you might want to convert to decibels first as well.

Dec 28, 2011 at 5:05 PM

Thank you for your help.