Is there a way to get a microphone input event in c#? I would like to display a progress bar that goes up and down with the voice level.
Asked
Active
Viewed 2.7k times
3 Answers
8
This link may help:
http://blogs.msdn.com/b/coding4fun/archive/2009/10/08/9905168.aspx
The post includes instructions on capturing the microphone level, etc.

code4life
- 15,655
- 7
- 50
- 82
-
resource is no longer available. – IdontCareAboutReputationPoints Aug 18 '17 at 13:18
-
The current version of this page is at [Channel9](https://channel9.msdn.com/coding4fun/articles/NET-Voice-Recorder). – David Bremner Aug 08 '18 at 16:28
5
What you're looking for is example source code for a VU meter. You can get the audio capture buffer with the Win32 API, but I've found it is far easier to use the BASS library. There is a .NET wrapper for it that is used by many projects out in the wild.
BASS: http://www.un4seen.com/
BASS.NET: http://www.un4seen.com/download.php?z/4/Bass24.Net.zip
In the examples zip file, you find some code for a VU meter. Their DLL does all of the work for you.

Brad
- 159,648
- 54
- 349
- 530
0
XNA has support for capturing the microphone. See:
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.microphone.aspx

steinar
- 9,383
- 1
- 23
- 37