Multiple Microphones and noise subtraction

Jan 22, 2010 at 8:52 PM
Edited Jan 27, 2010 at 3:52 AM

First thanks for such a useful and well organized project!  I am working on C# project that needs the following functionality.  Could you let me know if NAudio can handle these tasks or maybe point me in the right direction.

1)  Can NAudio listen on multiple microphone for a command phrase (ie. "Hello").  When the command is recognized I need to mute the audio from the other audio input sources.

2)  Take Audio input from a stereo (plugged into the PC line-in) and a microphone.  Then somehow subtract off line-in audio stream from the microphone stream to get rid of the stereo music.

3)  On the output side I would like to be able dynamic send audio to different destinations.  Based on user inputs the sound would go to 1 of four speakers in the room.

4)  Improve the quality of a microphone input for speech recognition to allow the user to be further from the microphone.  Here again I am wondering if NAudio has some APIs that might facilitate this goal.

Sorry for the flood of questions, hopefully others will benefit as well...

Thanks Again,


Jan 27, 2010 at 3:54 AM
Edited Jan 27, 2010 at 3:57 AM

Still struggling with these questions.  If someone happens happens to have a lead on any of these issues it would be much appreciated.  Is the right application for NAudio or is there a namespace in MSDN that is suited for my goals.  I am beginning to feel that Audio is the weak link in the Windows environment.



Jan 28, 2010 at 3:09 PM

hi thebrandons

1) Naudio cannot do speech recognition. You would have to use the speech API to do this

2) This is easier said than done. Cancelling audio requires it to be perfectly in phase and the same volume. What exactly are you trying to acheieve

3) This depends on your soundcard. If it presents its outputs as different devices then it is easy in NAudio, simply choose different WaveOut devices. If it presents itself as a single multi-channel device, that is much harder

4) You could possibly write a high-pass filter to remove rumble (and maybe a low-pass filter too to remove hiss). NAudio doesn't have anything built in. The best approach is to use a decent microphone with a wind filter and go through a mixer with the appropriate EQ capabilities.

So sorry, NAudio doesn't have any built-in solutions to your needs. And yes, Audio support on windows is still fairly rudimentary (or at least the APIs are not particularly user friendly).


Jan 28, 2010 at 11:19 PM


Thanks for your response as it is hard to find expertise in this area.  Allow me to rephrase some of my questions to clarify my problem.

0)       Do you know the fundamental .NET Audio Namespaces/Classes available?  Would you mind listing some basics as I assume NAudio is a complex wrapper to these APIs.  I am also trying to figure out where the .NET APIs stop and NAudio functionality starts?

1)       I need to be able to target a specific microphone.  I can handle the speech recognition part of the problem.  However I need each microphone to appear as a different source with each being analyzed by the speech recognition engine simultaneously/independently.  I do not know if either of these objectives are possible?

2)       Can I subtract noise from a PC line-in (Hook to office radio) from the microphone which is in the same room?  Basically I need the microphone to pick out my voice, for speech recognition, despite the fact that the microphone will hear the radio.  Perhaps I am shooting to high but I was hoping NAudio could help me give this a try.  Can NAudio help with subtraction, phase, and volume issues?  Again is there a .NET namespace that might be better suited?

3)       I have a soundcard with multi-channel outputs.  Does NAudio provide APIs to help target a particular channel?  Otherwise do you know which MS namespace could do the job?

4)       Improve microphone sound quality if user moves away from microphone.  You mentioned filters but I can not find the MS namespace that helps in this area?

Again that’s for accepting my questions.  I am finding audio programming to be very challenging, and understand why NAudio is needed.


Feb 9, 2010 at 7:14 PM

Can anyone help me on this....