View Full Version : MP3 -> PCM converter preview (incomplete)

01-14-2008, 03:16 AM
I've translated enough of the LIBMAD MP3 code into SPIN to generate the first 576 PCM samples of a test MP3 file.· It gives exactly the same values as LIBMAD (with the appropriate compiler flags).· These 576 samples represent the first channel of the first granule of the first frame.· It is incomplete, but it does give me a good idea of the·memory requirements for a Prop (or Prop II) MP3 player.·

I couldn't fit it into a single file, so there is a part A and part B.· Part A decodes the Huffman data and generates the·frequency domain samples.· Part B converts to·time domain and then does the synthesis.

I'll put the associated data files on my web site later...

Regarding MP3 playback on Prop, I have two concerns; memory and speed.· The nice thing about having SPIN and ASM on this platform is that they seem to generate about the same memory size code.· So, I figure that if I can squeeze this down to 32k, then maybe it's possible.· Also, SPIN is known to be 40-200 times slower, so if this can be done within that factor of real-time, maybe an assembly version could do real-time playback.

I've already taken some liberties with LIBMAD and made some long tables into word tables because with the "FPM_default" compiler flag, the result wasn't affected.· Also, many of the arrays are only sized for a single channel.
Even so, there's not much room left with 64k in two files.· But, I think may arrays could be converted from long to word with acceptable loss in quality...

At this moment, I am highly pessimistic about real-time playback with Prop1.· This is mostly due to memory space.· I haven't looked at speed too much, but the lack of·a multiply instruction is going to be a real problem...

Post Edited (Rayman) : 1/15/2008 1:49:48 AM GMT

01-14-2008, 05:09 AM
Rayman, Your off to a good start! :)
I'm not sure if the Prop 1 can decode MP3 in realtime, but the propII should. :)

I'm cheering you on!

Share the knowledge: propeller.wikispaces.com (http://propeller.wikispaces.com)
Lets make some music: www.andrewarsenault.com/hss (http://www.andrewarsenault.com/hss)

01-14-2008, 05:55 AM
excellent progress RayMan, looking forward to having a look at it tomorrow, going to bed now, after posting 3DMM link.


01-15-2008, 01:17 AM
I put some more info here:


I took a closer look at the memory requirements and I think the arrays could be shrunk down to 21 kB, leaving ~ 10 kB for code.· So, perhaps it's plausible still...

05-07-2012, 02:27 AM
Did this go anywhere from back in 2008? I'd love to put a MP3 player on the propeller.

05-07-2012, 10:53 AM
I think I gave up and decided to wait one year for Prop2 :)

It will be very easy to do on Prop2 though I think. Especially, if we can use the actual C code to do it...