Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By earlephilhower
#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.

It's available at GitHub:

[edit 8/17] FLAC support was just added via libFLAC 1.3.2
Last edited by earlephilhower on Thu Aug 17, 2017 11:38 pm, edited 1 time in total.
User avatar
By reaper7
#69052 very nice!
what about SD card support?
there's no file seek(pos, dir) only seek(pos) :roll: