solucion-incompatibilidad-libreria-esp8266audio-esp32

How to resolve ESP8266Audio compatibility issue with ESP32

  • 2 min

If you have an ESP32 audio project using the ESP8266Audio library, you might have been unpleasantly surprised to find that it doesn’t work.

This problem occurs when we use the ESP8266Audio library with an ESP32 Core version higher than 2.0.3. Then… BOOM! 💥

If when compiling you get an error saying that SPECIAL is not defined, something like this, then it’s happening to you too. But don’t worry, there’s an easy solution!

error: ‘SPECIAL’ was not declared in this scope pinMode(sck, SPECIAL);

Logically, the problem arises due to changes in the ESP32 Core definitions for Arduino, which create an incompatibility with the ESP8266Audio library, preventing it from working correctly.

Fortunately, thanks to the community and Open Source, the library has a Pull Request (PR) that fixes these issues. Pull Request #505

The ESP8266Audio library is not actively maintained (it has 22 PRs pending acceptance). So, for now, the PR hasn’t been accepted. But we can fix it by downloading the fork directly.

Specifically, the user Tobozo (hey! thanks Tobozo!) is the one who fixed the library to resolve the incompatibility with the latest versions of ESP32. Here is the link to the Fork with the Solution

To apply this solution, simply:

  1. Download the code from the fork at the link I provided
  2. Unzip the file
  3. Go to your system’s Arduino installation folder
  4. In the Arduino folder, go to the “libraries” directory
  5. Replace the “ESP8266Audio” folder in your Arduino installation with the folder downloaded from the fork

Once these steps are completed, it should work! The ESP8266Audio library should function without problems on newer versions of ESP32.

This is a temporary solution until the original maintainer of the ESP8266Audio library accepts the PR and releases a new version that fixes the compatibility issue.

But in the meantime, at least you have a work-around to get ESP8266Audio working with the latest ESP32 Core definitions 😉.