How to monitor microphone input level?
I'm using VB.net with Framework 2.0.
How to monitor the mic level of the default soundcard? I would like to be able to set a threshold value (0-100%) and when the mic level is greater than that a message box would appear. It would be important that the detection would be fast (with as short delay as possible) and consume CPU resources as little as possible. Is this possible without DirectX SDK?
I found some code in VB6 and C but could not translate them in VB.net.
Thank you!
I don't believe that the .NET classes include such implementation, DirectX would be the best way for this as it contains everything you need in regards to multimedia (video and audio)
I will move this thread to the DirectX forums where they will be able to respond to your query better. My apologies if the thread has been moved into the incorrect DirectX subforum
Thanks
With the DirectSoundCapture interfaces you can retrieve input sound from the default input device set on the Windows Multimedia options. Then you can read the input results from there and compare them against the threshold that you want...
For more information, look at IDirectSoundCapture8 and IDirectSoundCaptureBuffer8 interfaces...
On the other hand, this is also perfectly achievable with the Win32 multimedia APIs. Look at the waveIn* APIs on MSDN... Note that these use a different approach than that of DSound's. (IMO DSound is easier)
If this is possible to with Win32 APIs, I would prefer that way. I have googled and googled but found nothing but C code or VB6.0 code. I'm a beginner and would need very basic step-by-step instructions how to solve this problem... I would be most grateful, if someone could help me and give me simple enough guidance. Thanks!
Of course it wouldn't hurt to read more literature. But considering my personal goals in the art of coding, a direct and fully-explained example would have been the best solution. I am a beginner and programming is more sort of a hobby. I learn best by manipulating working examples.
So, I still kindly ask for help...