コード例 #1
0
        public void RefreshAudioDevices()
        {
            AudioDeviceDropdown.Items.Clear();

            foreach (var device in AudioSession.RequestAllDevices())
            {
                if (device.State.HasFlag(AudioDeviceStates.Active))
                {
                    AudioDeviceDropdown.Items.Add(device);
                }
            }

            CurrentAudioDevice = AudioSession.RequestDefaultSpeakers();

            AudioDeviceDropdown.SelectedValue = CurrentAudioDevice.Id;
        }