namespace Nonemm.Recorder; /// A device the backend lists. `Channels` is the most it can give at once. public sealed record AudioDeviceInfo(string Name, bool IsOutput, int Channels) { /// One entry for each channel the device has. public IEnumerable Sources() => Enumerable.Range(0, Math.Max(1, Channels)) .Select(channel => new ChannelSource(Name, IsOutput, channel, Math.Max(1, Channels))); }