Код: Выделить всё
void Initialize()
{
_WaveOut = new WaveOut();
var reader = new WaveFileReader(FileName);
_WaveOut.Init(new WaveChannel32(reader));
}
Код: Выделить всё
for (int i = 0; i < WaveOut.DeviceCount; i++)
{
WaveOutCapabilities WOC = WaveOut.GetCapabilities(i);
comboBox2.Items.Add(WOC.ProductName);
}
Код: Выделить всё
int WaveOutDeviceId = comboBox2.SelectedIndex;
Код: Выделить всё
void Play()
{
_WaveOut.DeviceNumber = WaveOutDeviceId;
_WaveOut.Play();
}
Подробнее здесь: https://stackoverflow.com/questions/132 ... -device-id