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
  • 6,086
  • 19
  • 59
  • 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,655
  • 7
  • 50
  • 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
  • 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