Get WaveIn Audio Volume

Jan 17, 2011 at 4:58 PM

Hi,

Does anyone know how to get the volume of the sound being recorded by NAudio, I've tried various snippets on this forum but they aren't working as I would expect (A 0-1 or 0-100 float that represents the volume of the audio).

Any help on this is appreciated,

Thanks,

Danny

Coordinator
Jan 18, 2011 at 5:50 PM

have a look at the NAudio demo, which draws a waveform and shows a volume meter

Jan 18, 2011 at 6:35 PM

I've had a look at that document and it works great (i.e. I've been able to grab the volume of a file being played) but how would I port it over to grab the audio of a, say microphone?

Excuse my ignorance but audio is a new field for me and I'm unable to find any documentation.

Thanks

Coordinator
Jan 18, 2011 at 7:33 PM

for a recording example, have a look at the .NET voice recorder: http://voicerecorder.codeplex.com and see my article on coding4fun:

http://blogs.msdn.com/b/coding4fun/archive/2009/10/08/9905168.aspx

Mark

Jan 18, 2011 at 8:17 PM

That's EXACTLY what I'm after, thanks a lot Mark!

Btw I noticed waveIn.DeviceNumber is missing from the latest version, any alternatives or has it been completely removed?

Thanks again.

Coordinator
Jan 18, 2011 at 9:33 PM

it's still part of WaveIn, just not in IWaveIn, as that interface can be implemented by other technologies that don't have a concept of device number

Mark