private void AudioEvents_OnAudioDeviceRemoved(object sender, AudioEvents.MMDeviceAddedRemovedArgs e) { Console.WriteLine("Removed audio device: " + e.deviceId); var guid = MMDevices.ParseWasapiGuid(e.deviceId); if (guid != Guid.Empty) { Dispatcher.Invoke(new Action <Guid>(RemoveInput), guid); } }
private void AudioEvents_OnAudioDeviceAdded(object sender, AudioEvents.MMDeviceAddedRemovedArgs e) { Console.WriteLine("Added audio device: " + e.deviceId); var guid = MMDevices.ParseWasapiGuid(e.deviceId); if (guid != Guid.Empty) { Dispatcher.Invoke(new Action <Guid>(AddInput), guid); } Dispatcher.Invoke(new Action(() => { if (InputList != null && InputList.Count > 0) { if (SelectedInputSource == null) { SelectedInputSource = InputList[0]; } SelectActiveInputGroup(); } })); }