public WindowsMicMute() { try { this.vistaMicMute = new CoreAudioMicMute(); //for some reason I had to call this to setup the Audio Interfaces on startup instead of later or I get invalid cast com exceptions (I think because it was all initialized from separate threads) this.vistaMicMute.SetMute(true); this.vistaMicMute.SetMute(false); } catch { this.vistaMicMute = null;//we'll try the old (xp) way } }
public String[] SearchDevices() { String[] devices = null; try { this.vistaMicMute = new CoreAudioMicMute(); devices = this.vistaMicMute.SearchDevices(); //for some reason I had to call this to setup the Audio Interfaces on startup instead of later or I get invalid cast com exceptions (I think because it was all initialized from separate threads) this.vistaMicMute.MuteAll(true); this.vistaMicMute.MuteAll(false); } catch { this.vistaMicMute = null;//we'll try the old (xp) way devices = MixerNativeLibrary.MicInterface.SearchDevices(); } return(devices); }