Beispiel #1
0
        private void SetAudioDevices()
        {
            if (this.AudioDeviceSelect == null)
            {
                return;
            }

            var selected = this.AudioDeviceTypeSelect.SelectedValue as ListBoxItem;

            if (!Enum.TryParse(selected.Content as string, true, out AudioDeviceType type))
            {
                type = Zokma.Libs.Audio.AudioDeviceType.WASAPI;
            }

            var devices = AudioDevice.GetAudioRenderDevices(type);

            this.AudioDeviceSelect.Items.Clear();
            foreach (var item in devices)
            {
                this.AudioDeviceSelect.Items.Add(new AudioDeviceItem {
                    AudioDevice = item
                });
            }

            this.AudioDeviceSelect.SelectedIndex = 0;
        }