Shop OBEX P1 Docs P2 Docs Learn Events
MP3 -> PCM converter preview (incomplete) — Parallax Forums

MP3 -> PCM converter preview (incomplete)

RaymanRayman Posts: 14,833
edited 2012-05-07 03:53 in Propeller 1
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

Comments

  • Ym2413aYm2413a Posts: 630
    edited 2008-01-13 22:09
    Rayman, Your off to a good start! [noparse]:)[/noparse]
    I'm not sure if the Prop 1 can decode MP3 in realtime, but the propII should. [noparse]:)[/noparse]

    I'm cheering you on!

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

  • BaggersBaggers Posts: 3,019
    edited 2008-01-13 22:55
    excellent progress RayMan, looking forward to having a look at it tomorrow, going to bed now, after posting 3DMM link.

    Baggers
  • RaymanRayman Posts: 14,833
    edited 2008-01-14 18:17
    I put some more info here:

    http://www.rayslogic.com/propeller/Programming/RaysStuff/MP3/MP3.htm

    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...
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-05-06 19:27
    Did this go anywhere from back in 2008? I'd love to put a MP3 player on the propeller.
  • RaymanRayman Posts: 14,833
    edited 2012-05-07 03:53
    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...
Sign In or Register to comment.