private void PopulateMicrophones() {
List<String> waveInDevices = Enumerable.Range(0, WaveIn.DeviceCount)
.Select(i => WaveIn.GetCapabilities(i).ProductName)
.ToList();
waveInDevices.Insert(0, "Select Mic");
MicrophoneDropdown.ItemsSource = waveInDevices;
if (waveInDevices.Count > 0)
{
MicrophoneDropdown.SelectedIndex = 0; // Set the first microphone as default selected
}
}
private void PopulateMicrophones() {
List<String> waveInDevices = Enumerable.Range(0, WaveIn.DeviceCount)
.Select(i => WaveIn.GetCapabilities(i).ProductName)
.ToList();
waveInDevices.Insert(0, "Select Mic");
MicrophoneDropdown.ItemsSource = waveInDevices;
if (waveInDevices.Count > 0)
{
MicrophoneDropdown.SelectedIndex = 0; // Set the first microphone as default selected
}
}