2015-01-05 10:46 PM
Hello,
I am currently developing an application based on the STM32F401VC-Discovery Board to decode the MP3 data anhd play it out as WAV. I have tried different methods as suggested by everyone but comes out with no result as all. I found out the main problem seems to be dealing with the malloc side as the board cannot allocate the required memory. So, I opt for the optimized version of Libmad from Philips. Still, nothing happened. Can somebody tell me whether is this STM32F401 suitable for the Libmad or shall I changed the board to STM32F407 (maybe)? Below are some details about the STM32F401:-2015-01-06 08:53 AM
Haven't used LIBMAD, presumably there are some specification / requirements provided. Suggest you use the library on a PC, and understand how the data goes in and comes out, and the resources (memory) it takes.
ST also has a library, but suspect you have to request it from them.http://www.st.com/st-web-ui/static/active/cn/resource/technical/document/data_brief/DM00024441.pdf
2015-01-06 08:10 PM
Hello Mr. clive1,
Thanks for your suggestion. May I know is the f_read functions in the STM32 from Chan Library will read the next bulk of data after being called the second time? Like this:-f_read(&FileRead, ReadStart, ReadSize, &br);
In the code above, when we read the MP3 for the first time, we will get the MP3 header being stored in the ''ReadStart'' address. What if I called the function ''f_read'' above for two times like below:-
f_read(&FileRead, ReadStart, ReadSize, &br);
f_read(&FileRead, ReadStart, ReadSize, &br);
Will it update it's pointer and read the upcoming bytes or still read from the start?
Sincerely,
Kwan
2015-01-07 03:56 AM
Will it update it's pointer and read the upcoming bytes or still read from the start?
It continues to read the next bytes, if present in the file. The f_read() function is similiar to the Posix function read(). But since some clib support is missing (like errno), the interface (parameters) had to be changed. BTW: I never tried MP3/libmad on a STM32, but would be surprised if there is a free compatible port. On my Linux host, it shows linkage against libc and liblinux.
2015-01-07 05:29 PM
Hello Argentum,
Thanks for your explanation. BTW: I will share out the code here as soon as it's done for anyone interested to try it out in an easier way.Sincerely,Kwan