Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 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;
 }