User mini profile

- Sat Aug 12, 2017 12:25 pm#68991
I've created a library for the ESP8266 Arduino IDE which can play stereo MP3s, WAVs, and MODs over an I2S DAC or using the I2S as a 32x oversampling delta-sigma DAC for a 1-transistor speaker output.

The MP3 playback is a clean room port of the libmad sources. I looked at the NONOS-SDK version, but frankly comments like "I breaked things..." for GIT commits made me stop right there. This new port runs under the Arduino IDE and supports stereo output at 44.1khz. Stack usage is about 1K, and HEAP maximum is ~34K, but when not actually in the decoder about 10KB add'l are freed.

The I2SNoDAC class implements a delta-sigma ADC with 32x to 128x oversampling (but at 44.1khz only 32x is supported because of I2S interface max clock limitations). At 32x oversampling and 44.1khz it sounds very good even without a low-pass filter. Unlike the NONOS-SDK this is not a hardcoded lookup table, but dynamically interpolates every bit and should give an effective 8-12 bit dynamic range.

The library includes samples and the readme shows the schematic for the 1-transistor speaker driver, and can read from SPIFFS or PROGMEM.

There are also Microsoft WAV playback objects and Amiga ModTracker (chiptunes!) objects.