1

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.

Robert
  • 5,866
  • 18
  • 58
  • 84

3 Answers3

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,339
  • 7
  • 49
  • 82
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
  • 152,561
  • 47
  • 332
  • 504
0

XNA has support for capturing the microphone. See:

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.audio.microphone.aspx

steinar
  • 9,122
  • 1
  • 21
  • 36