I know that MP3 is the most popular audio format out there, but I need to be able to convert them to wav files for bother project I'm working on. It can be done with a PC but I would like to know if there is a way of decoding a MP3 file and turning it into a pcm wav file on an Arduino. I don't want to use an extra chip, as I do not plan on playing the MP3s, just converting them.
1 Answer
The mp3 audio coding is not just one mathematical calculation. To decode every mp3 file you need a complete package and enough memory. That is not something for a simple arduino board.
There are libraries to decode for example a jpg file or a mp3 file. They have restrictions and you need a faster processor.
Adafruit has made a start: https://learn.adafruit.com/native-mp3-decoding-on-arduino/, but you need a powerful non-standaard arduino-compatible board. That library does not use I2S yet.
I suggest to use a Raspberry Pi.
-
It's something I made a start on too. Porting the Microchip code. However, it will not, and will never, run on a little Arduino. It's intended for chipKIT boards with hundreds of kB of RAM.– MajenkoCommented Aug 11, 2018 at 9:20
-
Isn't there a way to decode a segment at a time? I would like to read a sector, decode it, write it to a file, then repeat. If necessary, would it be possible to use a temporary file on an sd card as spare memory?– user35284Commented Aug 14, 2018 at 8:54