Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3
A MP3 and AAC Decoder using Helix for ESP32
License
mkopa/libhelix-esp32-arduino
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a fork of thehttps://github.com/pschatzmann/arduino-libhelix library
The changes are in memory allocation, the idea is to use external SPI RAM instead of the built-in DRAM.
lib_deps = https://github.com/mkopa/libhelix-esp32-arduinolib_ldf_mode = deep+build_flags = -DBOARD_HAS_PSRAM # Enable SPI PSRAM -mfix-esp32-psram-cache-issue # For older IDF compatibility
I am providing theHelix MP3 decoder from RealNetworks as a simple Arduino Library. The Helix decoders are based on 16bits integers, so they are a perfect fit to be used in Microcontrollers.
MP3 is a compressed audio file formats based on PCM. A 2.6 MB wav file can be compressed down to 476 kB MP3.
This project can be used stand alone or together with thearduino-audio_tools library. It can also be used from non Arduino based systems with the help of cmake.
The Helix MP3 decoder provides Layer 3 support for MPEG-1, MPEG-2, and MPEG-2.5. It supports variable bit rates, constant bit rates, and stereo and mono audio formats.
The API provides the decoded data to a Arduino Stream or alternatively to a callback function. Here is a MP3 example using the callback:
#include "MP3DecoderHelix.h"#include "music_mp3.h"using namespace libhelix;void dataCallback(MP3FrameInfo &info, int16_t *pwm_buffer, size_t len) { for (int i=0; i<len; i+=info.channels){ for (int j=0;j<info.channels;j++){ Serial.print(pwm_buffer[i+j]); Serial.print(" "); } Serial.println(); }}MP3DecoderHelix mp3(dataCallback);void setup() { Serial.begin(115200); mp3.begin();}void loop() { Serial.println("writing...") mp3.write(music_data, muslic_len); // restart from the beginning delay(2000); mp3.begin();}
For 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
cd ~/Documents/Arduino/librariesgit clone pschatzmann/arduino-libhelix.git
This project can also be built and executed on your desktop with cmake:
cd arduino-libhelixmkdir buildcd buildcmake ..make
- TheClass Documentation can be found here
- I also suggest that you have a look atmy related Blog
This library is based on a adapted version of libhelix fromEarle Phil Hower's ESP8288Audio library
The decoder code is from the Helix project and licensed under RealNetwork'sRPSL license. For commercial use you might still going to need the usual AAC licensing.
About
A MP3 and AAC Decoder using Helix for ESP32
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.