I recently began coding a C# program that does simple audio recording via a microphone connected to a PC (i.e. laptop microphone, desktop headset, etc etc...).
So now, I've got everything done like recording, pausing, stopping, saving, and replaying, but I can't seem to code the last feature: muting the microphone. This means that the program continues to record audio, but the recorded data is silence because the microphone is muted and there is no input from the microphone.
I've done some searching and all I found is actually disabling the hardware itself in order to mute it, rather than just cutting input from the microphone hardware.
Can anyone here show me how to stop receiving input from the microphone in C#? And then, restore back to receiving input when selected to do so?
EDIT: I should also say that I'm using winmm.dll as an dll import, like this:
[DllImport("winmm.dll",EntryPoint="mciSendStringA", ExactSpelling=true,
CharSet=CharSet.Ansi, SetLastError=true)]
private static extern int record(string lpstrCommand, string lpstrReturnString,
int uReturnLength, int hwndCallback);`