示例#1
0
        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);
            }
        }
示例#2
0
        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();
                }
            }));
        }