private bool ExistDevice(string deviceId) { ISoundDeviceList outputDevices = new ISoundDeviceList(SoundDeviceListType.PlaybackDevice); for (int i = 0; i < outputDevices.DeviceCount; i++) { if (outputDevices.getDeviceID(i) == deviceId) { return(true); } } return(false); }
private string DeviceDialog() { Console.WriteLine("Output devices: "); ISoundDeviceList outputDevices = new ISoundDeviceList(SoundDeviceListType.PlaybackDevice); for (int i = 0; i < outputDevices.DeviceCount; i++) { Console.WriteLine(i.ToString() + ": " + outputDevices.getDeviceDescription(i)); } Console.Write("Choose device (0): "); var deviceString = Console.ReadLine(); int deviceIndex = deviceString.Length != 1 ? 0 : int.Parse(deviceString); string deviceID = outputDevices.getDeviceID(deviceIndex); return(deviceID); }
private string DeviceDialog() { Console.WriteLine("Output devices: "); ISoundDeviceList outputDevices = new ISoundDeviceList(SoundDeviceListType.PlaybackDevice); for (int i = 0; i < outputDevices.DeviceCount; i++) { Console.WriteLine(i.ToString() + ": " + outputDevices.getDeviceDescription(i)); } Console.Write("Choose device (0): "); var deviceString = Console.ReadLine(); int deviceIndex = deviceString.Length != 1 ? 0 : int.Parse(deviceString); string deviceID = outputDevices.getDeviceID(deviceIndex); return deviceID; }
private bool ExistDevice(string deviceId) { ISoundDeviceList outputDevices = new ISoundDeviceList(SoundDeviceListType.PlaybackDevice); for (int i = 0; i < outputDevices.DeviceCount; i++) { if (outputDevices.getDeviceID(i) == deviceId) { return true; } } return false; }