MP3 Player without external hardware MP3 Player without external hardware. A software based MP3 player based on a modified version of libmad. Mono output (at the moment) via AnalogOut. Files are read from an USB drive. This is a demo program, it plays only one file at the moment. Documentation is in "main.cpp" and "config.h"
lpc1768_mem.cpp
- Committer:
- Gruenfrosch
- Date:
- 2010-11-27
- Revision:
- 2:f28cf0afd021
File content as of revision 2:f28cf0afd021:
#include "mbed.h" #include "config.h" static char *free_ptr = (char *)AHBMEM; static int free_sz = AHBMEMSIZE; void reset_ahb_mem(void) { free_ptr = (char *)AHBMEM; free_sz = AHBMEMSIZE; } void *mad_malloc(unsigned int sz) { unsigned int nsz = ((sz >> 3) + 1) << 3; // align to 8 byte if(nsz < free_sz) { char *p = free_ptr; free_ptr += nsz; free_sz -=nsz; return(p); } else { return(malloc(sz)); } }