For the guys that were interested in my last post. I published the code here: madplayer
This is a port of the libmad library. It is modified to use part of the AHB RAM because the available standard RAM is too small. The demo program plays a fixed file from an USB drive, output goes to AnalogOut, one channel only at the moment.
Documentation is in the code.
Edited: removed the last compiler warning...
Great job!. I modify the output to PWM , with the standar clock is 25khz an 12 bits, but is ready for stereo. I can´t . Is the size of free RAM enough for double buffer?. The sound´s quality is near DAC and direct to amplifier.
Good work man.
Posted a new version, that moves more memory to AHB RAM. Now there is space for stereo buffer, demo in main.cpp
I´m waiting for the stereo version. I modified your code and for PWM in stereo without problems . The next level would be a SPI or I2C DAC for 16bits . Now is only 12bits.
Thanks for all
Friends, I'm starting now with the MBED. Outside the module MBED what else might be needed? as I connect this additional RAM? what kind would it be? Could someone provide the schematic of this additional part?Thanks to all
@Jairo: when starting with a new platform it is a good idea to go through the manuals to get familiar with the concepts, like AHB RAM. This website has very good tutorials for getting started, e.g. with the online compiler and how to import programs.
Could you please advise how to:
1) start madplayer at desired frame-number or time
2) stop madplayer with external signal(GPIO line) and get the current frame or time
I tried your Madlib project and it works out of the box. It was easy to add an WM8762 on the I2S interface to get stereo output at headphone level.
Thanks for doing the difficult part,
I am porting libmad to LPC1768, but in another IDE (IAR). I am having troubles when sharing the RAM memory with stack and heap sections. Could you tell us how you dealed with it? Thanks, Marcel
I've been looking into this project also. In decoder.cpp, the original code is adapted to:
decoder->sync = (struct mad_sync_s *)malloc(sizeof(*decoder->sync));
decoder->sync->synth = (struct mad_synth *)mad_malloc(sizeof(struct mad_synth));
decoder->sync->synth = (struct mad_synth *)malloc(sizeof(struct mad_synth));
The implementation of mad_malloc is in lpc1768_mem.cpp; it uses the 16kb ethernet block.
I hope this helps you.
hey thank you so much for this!! just a simple question..what is the size of your ram? also, is it possible to make the volume of the sound increasing gradually? thanks a lot :)
Please log in to post a reply.
mbed, the fastest way to prototype with ARM based microcontrollers.
^ back to top