/// <summary>
        ///   Creates a <see cref="AudioDeviceCollection"/> class containing
        ///   devices of the given <see cref="AudioDeviceCategory">category</see>.
        /// </summary>
        ///
        /// <param name="category">The category of the devices.</param>
        ///
        public AudioDeviceCollection(AudioDeviceCategory category)
        {
            this.Category = category;

            // Set default device
            DeviceInformation info = new DeviceInformation(Guid.Empty,
                                                           Category == AudioDeviceCategory.Output ? "Primary Sound Driver" : "Primary Sound Capture Driver",
                                                           String.Empty);

            this.Default = new AudioDeviceInfo(info);
        }
示例#2
0
        /// <summary>
        ///   Creates a <see cref="AudioDeviceCollection"/> class containing
        ///   devices of the given <see cref="AudioDeviceCategory">category</see>.
        /// </summary>
        ///
        /// <param name="category">The category of the devices.</param>
        ///
        public AudioDeviceCollection(AudioDeviceCategory category)
        {
            this.Category = category;

            // Set default device
            DeviceInformation info = new DeviceInformation();

            if (Category == AudioDeviceCategory.Output)
            {
                info.Description = "Primary Sound Driver";
                info.DriverGuid  = Guid.Empty;
            }

            else if (Category == AudioDeviceCategory.Capture)
            {
                info.Description = "Primary Sound Capture Driver";
                info.DriverGuid  = Guid.Empty;
            }

            this.Default = new AudioDeviceInfo(info);
        }