earlephilhower / ESP8266Audio

Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
GNU General Public License v3.0
2.01k stars 432 forks source link

bug: oversample 256 #542

Closed kimstik closed 2 years ago

kimstik commented 2 years ago

as per oversample is uin8_t it cannot hold value bigger than 255 file AudioOutputI2SNoDAC.cpp

bool AudioOutputI2SNoDAC::SetOversampling(int os) {
  if (os % 32) return false;  // Only Nx32 oversampling supported
  if (os > 256) return false; // Don't be silly now!
  if (os < 32) return false;  // Nothing under 32 allowed

  oversample = os;
  return SetRate(hertz);
}
earlephilhower commented 2 years ago

Very good catch, thanks!