Initial commit — WPF guitar note name tutor using FFT frequency detection

This commit is contained in:
2026-05-09 03:17:07 +00:00
commit 99b73f710a
30 changed files with 1637 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
using System.Windows;
using SoundCapture;
namespace GuitarNoteNameTutor
{
/// <summary>
/// Interaction logic for SelectDevice.xaml
/// </summary>
public partial class SelectDevice
{
SoundCaptureDevice[] _devices;
public SoundCaptureDevice SelectedDevice
{
get { return _devices[devicesListBox.SelectedIndex]; }
}
public SelectDevice()
{
InitializeComponent();
}
private void LoadDevices()
{
devicesListBox.Items.Clear();
int defaultDeviceIndex = 0;
_devices = SoundCaptureDevice.GetDevices();
for (int i = 0; i < _devices.Length; i++)
{
devicesListBox.Items.Add(_devices[i].Name);
if (_devices[i].IsDefault)
defaultDeviceIndex = i;
}
devicesListBox.SelectedIndex = defaultDeviceIndex;
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
LoadDevices();
}
private void okButton_Click(object sender, RoutedEventArgs e)
{
DialogResult = true;
Close();
}
private void lbi_MouseDoubleClick(object sender, RoutedEventArgs e)
{
DialogResult = true;
Close();
}
}
}