Arduino LibLAME
|
LAME is a open source implementation of a MP3 encoder. This project just reorganized the code to follow Arduino Library conventions, so that you can use it in Arduino and PlatformIO.
I have also added a simple Arduino style C++ API which allows to output the resulting MP3 via to a Arduino Stream or to receive it via a callback.
Here is an example Arduino sketch for encoding PCM data into MP3:
In Arduino, you can download the library as zip and call include Library -> zip library. Or you can git clone this project into the Arduino libraries folder e.g. with
This project can also be built and executed on your desktop with cmake:
I recommend to use this library together with my Arduino Audio Tools. This is just one of many codecs that I have collected so far: Further details can be found in the Encoding and Decoding Wiki of the Audio Tools.
This library requires quite a lot of RAM and it should work if you just use this decoder w/o any additional functionality that requires additional RAM. If you want to use e.g. WIFI together with this library you might not have enough RAM: Fortunately this library supports PSRAM so if you activate PSRAM you should have more then enough headroom...
The initial restructured code was working prefectly with my Arduino Simulator on the desktop, but as soon I as I deployed it on an ESP32 it was crashing because of different reasons:
So I needed to adjust the original code quite a bit. You can activate some micro processor specific functionaitly in config.h.