MP3 decoder works!
Rayman
Posts: 14,665
Just played with libmad, an mp3 decoding software...
Only took a few minutes to get this going with PropGCC, now that I have xmm going with Rampage2.
It's nowhere near real time, but it actually works!
Maybe with Prop2 it could be used for real time playback.
Only took a few minutes to get this going with PropGCC, now that I have xmm going with Rampage2.
It's nowhere near real time, but it actually works!
Maybe with Prop2 it could be used for real time playback.
Comments
... another impossible one bites the dust?
I always thought MP3 Decoding require a license.
But, I'm no lawyer...
minimad is a tiny top level program that you can use to work with the libmad decoder.
What I did here is copy a whole mp3 file from Rampage2's uSD to memory.
test4b.mp3 is only a few kb, so there's plenty of room for it.
Then, I opened the wav version of test4b (test4b.wav) so that I could steal it's 44 byte header.
Then, I opened the output file, test.wav, and wrote that header.
Then, I called libmad and gave it the address of the mp3 file in memory.
Here's the output file (test.wav) too. There's a small glitch at the end for some reason, probably because the header has the wrong file length...
Just curious. Who owns the licensing rights?
http://mp3licensing.com/royalty/
looks like most of patents are expiring soon:
http://mp3licensing.com/patents/index.html
I say f'em. Around here software is not patentable anyway.
If you want to see how confusing this all is see:
http://en.wikipedia.org/wiki/MP3
I have always been under the impression that you had to buy a hardware MP3 decoder solution. That's why I bought hardware like the VMUSIC2 . My thinking was that they had bought the license and I could just use it and be done with it.
My have to read more about this now.
EDIT Sorry... it's Heater. now. I forgot
Additionally, patent holders have declined to enforce license fees on free and open source decoders, which has allowed many free MP3 decoders to be developed.
libmad is both free and open source (GNU license), so I think it qualifies...
I'd love to try this out on a P2...
Should be very much faster with the multiply instruction...
Maybe it was my understanding may moons ago when I first looked into MP3 players, (maybe 10 years ago?). At that time it was just hardware you could buy and it was license free.
So good that we now have a software option. Thanks for trying that out Ray!
I haven't timed it, but I'd say it decodes at a rate of 1 minute per 1 second of playback, or 1/60th of real time...
This is really more about P2 than P1.
But, perhaps in mono and at a very, very low bitrate you could make it work at 10 seconds per 1 second of playback.
Still not very exciting.
Lossless .wav playback is a much better solution for P1...
I suspect that MPEG1 layer 1 or ADPCM would be within the realms of decoding realtime by the Prop1. They don't provide as much compression (think 4:1 instead of 10:1) but with 8 cogs at 80MHz... I'm thinking doable.
===Jac
But, P2 has this, so I think it will easy run in 1 cog...