If you have an ARM Cortex M4 (or M3) based microcontroller board, and you want to rock out, this mini guide will be music to your ears. With the accompanying library, based off of Helix, you will be able to decode and play stereo MP3 files without the need for an external chip! That's right, no VLSI VS10xx chips required, you can do it on the fly!
MP3 files are very popular because of their widespread availability and small size. MP3 files are compressed, and can be 75 to 95% smaller in size than their original uncompressed form. This small size makes them great for embedded audio projects where storage can be an issue - WAV files are much easier to decode 'cause there is no compression, but that also made them very big.
Previously, the MP3 format was protected under patent, so anybody who wanted to sell products that used MP3 files would have to pay a licensing fee. Now those patents have expired and MP3 is freeeeee and you can embed the decoder into any project or product!
Because of this, we can now show you how to decode and play back MP3 files with just a powerful microcontroller like the Adafruit Metro M4 or Feather M4, Teensy 3.1, Teensy 3.2, and Teensy 3.6!
This is great news for cosplayers, halloween fans, prop-makers and all other types of DIY enthusiasts who want to add MP3 audio to their projects without the external hardware that was previously required (like the Adafruit Audio FX Sound Board).
TODO
A lot! This code isn't optimized, doesn't use DMA, requires two DACs at this time (doesn't support I2S)... but it is working proof-of-concept!
Compatible Microcontrollers
The Adafruit MP3 library is currently compatible with the Adafruit Feather / Metro M4, Teensy 3.1, Teensy 3.2, and Teensy 3.6 only.
The reason we like these is because all boards have a powerful ARM Cortex M4 at the heart and 1 or 2 12 bit DAC outputs (teensy 3.6 and feather/metro M4 have 2). This combo of processing power and 2 analog outputs is perfect for stereo audio processing with decent resolution, and no additional cost. They also have plenty of RAM for buffering data.
If you have a favorite Cortex M3/M4 chip, and you'd like to add support, please submit a pull request! (We only had these two boards on-hand.) You'll need about 32KB of RAM available and about 32KB of FLASH.
Basis
The Adafruit_MP3 library is a wrapper around the excellent Helix mp3 decoder, modified for ease of use.
Text editor powered by tinymce.