Beispiel #1
0
        public AudioChannel(AudioChannelRegisters registers, int clockSpeed, int sampleRate)
        {
            r = registers; r.Changed += OnRegisterChanged;

            Exception Overflow(string param)
            => new OverflowException($"{param} can't be less than or equal to 0");

            ClockSpeed = clockSpeed > 0 ? clockSpeed : throw Overflow(nameof(clockSpeed));
            SampleRate = sampleRate > 0 ? sampleRate : throw Overflow(nameof(sampleRate));
        }
Beispiel #2
0
 public NoiseChannel(AudioChannelRegisters registers, int clockSpeed, int sampleRate)
     : base(registers, clockSpeed, sampleRate)
 {
 }