Playing MP3s from an FPGA

Building an audio player is a fun project. It used to be quite a task to do so, but these days the MP3 decoder chips are full-featured which means that if you know how to talk to other chips with a microcontroller you’ve got all the skills needed to pull off the project. But that must have been too easy for [Ultra-Embedded], he decided just to build an MP3 player out of an FPGA.

It’s not quite as difficult as it first sounds. He didn’t have to figure out how to decode the audio compressions. Instead he rolled the Helix MP3 decoder library into the project. It had already been optimized to run on an ARM processor, and since he’s using a RISC soft processor the translation wasn’t tough at all. He’s using a 24-bit stereo DAC chip to bridge the gap between the audio jack and the FPGA output. Clocking that chip with the FPGA isn’t ideal and causes 44.1 kHz audio to run 3% too slow. He says it’s not noticeable, which we believe. But if you try to play along with a song the pitch shift might end up driving you crazy.

If you’d prefer to just stick to the microcontroller based players this one’s small and inexpensive.

Your theme song greets you at the front door

One thing you can look forward to when arriving at home after a long, arduous day at the office is some peppy theme music when you walk in the door. [Sebastian Sommer] built the system, and shows it off in the video after the break by dancing to James Brown’s I feel good.

The setup uses an Arduino as a microcontroller. It monitors a hall effect sensor on the jamb which detects a passing magnet on the door. We guess this means the system doesn’t know if you’re coming or going but perhaps a future upgrade would add an infrared beam to detect your legs as head out the door. The music itself is played by an SparkFun MP3 shield which has a decoder chip, microSD slot, and audio jack for the powered speakers. [Sebastian] grabbed a copy of [Bill Porter’s] mp3 shield library to get the project up and running quickly.

This is a pretty cool addition if you’re already using an Arduino for a door lock or vice versa. Or maybe you’re not home enough to make this hack worth it, in which case you simply must take this music playing Tesla coil hat along on your commute.

[Read more…]