This project has moved and is read-only. For the latest updates, please go here.

Mute linein

Nov 13, 2009 at 6:05 PM

First of all, thank you for providing this library - I am new to a/v and to .Net (coming from a Java background).  I have a simple task really, yet I can't seem to figure out a way of accomplishing it.  I would like to mute and unmute linein (there is an annoying 'pop' when I switch on linein device, and I'd like to just mute it for 1000 ms for the startup).  Any pointers greatly appreciated.


Nov 14, 2009 at 5:37 PM

Okay, I partially have this working.  I'm enumerating the mixerlines and can mute linein, but I can't un-mute it?  Is this a bug, or am I not doing something correct?

(control.ControlType == MixerControlType.Mute) { BooleanMixerControl muteControl = (BooleanMixerControl)control; if (b) { muteControl.Value = true; // this works } else { muteControl.Value = false; // this doesn't } }


Nov 16, 2009 at 10:24 AM

hmmm, not sure why. The mixer controls are a real pain to work with. Have you been able to step through the code and make sure the call to the mixer api is sending a sensible looking value?



Nov 19, 2009 at 5:16 PM

When I get a change I will see what I can do to try that - I'm using VS 2005, so at the moment I'm not able to compile NAudio from src and am only using the binary dist.


May 14, 2013 at 12:17 PM
Hi there. Thanks for this great library. I just encountered the same problem as kward. Using the MixerControlType.Mute works for mute but not for un-mute. Will there be a fix for this issue in future releases? I just want to know if someone is working on that before I might start diving into that part of the code.

May 15, 2013 at 3:51 PM
hi Markus, no there is no active development on the mixer API at the moment. It was one of the first bits of NAudio I did, back when I didn't have a clue about how to do P/Invoke, and hasn't turned out to be particularly useful to me, so it hasn't had much attention apart from a few occasional bugfixes. Another problem with the API is that since Windows Vista it has become very difficult to work out exactly which mixer control is which. But if you want to contribute a fix to the Mute control it would be greatly appreciated.