# Native MP3 decoding on Arduino

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/048/090/medium800/microcontrollers_adafruit_2357.jpg?1510262809)

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&nbsp; **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.&nbsp;MP3 files are compressed, and&nbsp;can be 75 to 95% smaller in size than their original uncompressed form. This small size makes them great for&nbsp;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!](https://blog.adafruit.com/2017/04/18/is-mp3-now-patent-free-makerbusiness-technicolor/)

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](https://www.adafruit.com/product/3382),&nbsp;Teensy 3.1, [Teensy 3.2](https://www.adafruit.com/product/2756), and&nbsp;[Teensy 3.6](https://www.adafruit.com/product/3266)!

&nbsp;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&nbsp;[Adafruit Audio FX Sound Board](https://www.adafruit.com/product/2220)).

# 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](https://www.adafruit.com/product/3382), Teensy 3.1, [Teensy 3.2](https://www.adafruit.com/product/2756), and&nbsp;[Teensy 3.6](https://www.adafruit.com/product/3266) only.

The reason we like these is because&nbsp;all&nbsp;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!](https://github.com/adafruit/Adafruit_MP3)(We only had these two boards on-hand.) You'll need about 32KB of RAM available and about 32KB of FLASH.

Warning: 

### Adafruit Metro M4 feat. Microchip ATSAMD51

[Adafruit Metro M4 feat. Microchip ATSAMD51](https://www.adafruit.com/product/3382)
Are you ready? Really ready? Cause here comes the fastest, most powerful Metro ever. The **Adafruit Metro M4** featuring the **Microchip ATSAMD51**. This Metro is like a bullet train, with its 120MHz Cortex M4 with floating point support. Your code will zig and zag...

In Stock
[Buy Now](https://www.adafruit.com/product/3382)
[Related Guides to the Product](https://learn.adafruit.com/products/3382/guides)
![Angled shot of a Adafruit Metro M4 feat. Microchip ATSAMD51. ](https://cdn-shop.adafruit.com/640x480/3382-13.jpg)

# Basis

The Adafruit\_MP3 library is a wrapper around the excellent&nbsp;[Helix](https://www.helixcommunity.org/projects/datatype/mp3dec)&nbsp;mp3 decoder, modified for ease of use.

- [Next Page](https://learn.adafruit.com/native-mp3-decoding-on-arduino/arduino-wiring-test.md)

## Featured Products

### Adafruit Metro M4 feat. Microchip ATSAMD51

[Adafruit Metro M4 feat. Microchip ATSAMD51](https://www.adafruit.com/product/3382)
Are you ready? Really ready? Cause here comes the fastest, most powerful Metro ever. The **Adafruit Metro M4** featuring the **Microchip ATSAMD51**. This Metro is like a bullet train, with its 120MHz Cortex M4 with floating point support. Your code will zig and zag...

In Stock
[Buy Now](https://www.adafruit.com/product/3382)
[Related Guides to the Product](https://learn.adafruit.com/products/3382/guides)
### MicroSD card breakout board+

[MicroSD card breakout board+](https://www.adafruit.com/product/254)
Not just a simple breakout board, this microSD adapter goes the extra mile - designed for ease of use.

- Onboard 5v-\>3v regulator provides 150mA for power-hungry cards
- 3v level shifting means you can use this with ease on either 3v or 5v systems
- Uses a proper level...

In Stock
[Buy Now](https://www.adafruit.com/product/254)
[Related Guides to the Product](https://learn.adafruit.com/products/254/guides)
### Teensy 3.6 without headers

[Teensy 3.6 without headers](https://www.adafruit.com/product/3266)
The awesome new **Teensy 3.6** is a small, breadboard-friendly development board designed by Paul Stoffregen and PJRC. Teensy 3.6 brings a low-cost **32-bit ARM Cortex-M4** platform to hobbyists, students and engineers, using an adapted version of the Arduino IDE...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3266)
[Related Guides to the Product](https://learn.adafruit.com/products/3266/guides)
### Breadboard-Friendly 3.5mm Stereo Headphone Jack

[Breadboard-Friendly 3.5mm Stereo Headphone Jack](https://www.adafruit.com/product/1699)
Pipe audio in or out of your project with this very handy breadboard-friendly audio jack. It's a stereo jack with disconnect-switches on Left and Right channels as well as a center ground pin. You can use any 3.5mm stereo cable with this jack. The pins are on 0.1" spacing so it plugs...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1699)
[Related Guides to the Product](https://learn.adafruit.com/products/1699/guides)
### Teensy 3.2 + header

[Teensy 3.2 + header](https://www.adafruit.com/product/2756)
[Teensy](http://www.pjrc.com/teensy/index.html) 3.2&nbsp;is a small, breadboard-friendly development board designed by Paul Stoffregen and PJRC. Teensy 3.2&nbsp;brings a low-cost 32 bit ARM Cortex-M4 platform to hobbyists, students and engineers, using an adapted version of the...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2756)
[Related Guides to the Product](https://learn.adafruit.com/products/2756/guides)

## Related Guides

- [Adafruit Metro M4 Express featuring ATSAMD51](https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51.md)
- [Animated NeoPixel Glow Fur Scarf](https://learn.adafruit.com/animated-neopixel-gemma-glow-fur-scarf.md)
- [How to train new TensorFlow Lite micro speech models](https://learn.adafruit.com/how-to-train-new-tensorflow-lite-micro-speech-models.md)
- [CircuitPython 101: Working with Lists, Iterators and Generators](https://learn.adafruit.com/circuitpython-101-list-and-things-iterators-generators.md)
- [Tiny Autostereogram Construction Kit](https://learn.adafruit.com/tiny-autostereogram-construction-kit.md)
- [Building CircuitPython](https://learn.adafruit.com/building-circuitpython.md)
- [Make It Talk](https://learn.adafruit.com/make-it-talk.md)
- [Using Python on Windows 10](https://learn.adafruit.com/using-python-on-windows-10.md)
- [Quickstart using Adafruit eInk/ePaper displays with CircuitPython](https://learn.adafruit.com/quickstart-using-adafruit-eink-epaper-displays-with-circuitpython.md)
- [CircuitPython Display Support Using displayio](https://learn.adafruit.com/circuitpython-display-support-using-displayio.md)
- [Visual Studio Code for Education... and CircuitPython](https://learn.adafruit.com/visual-studio-code-for-education-and-circuitpython.md)
- [2.8" TFT Touchscreen](https://learn.adafruit.com/2-8-tft-touchscreen.md)
- [Currying in CircuitPython](https://learn.adafruit.com/partials-in-circuitpython.md)
- [Ethernet for CircuitPython with Wiznet5K](https://learn.adafruit.com/ethernet-for-circuitpython.md)
- [Adafruit AirLift Shield - ESP32 WiFi Co-Processor](https://learn.adafruit.com/adafruit-airlift-shield-esp32-wifi-co-processor.md)
- [Adafruit 1.14" 240x135 Color TFT Breakout LCD Display](https://learn.adafruit.com/adafruit-1-14-240x135-color-tft-breakout.md)
