Skip to main content

Notice

Please be aware that much of the software linked to or mentioned on this forum is niche and therefore infrequently downloaded. Lots of anti-virus scanners and so-called malware detectors like to flag infrequently downloaded software as bad until it is either downloaded enough times, or its developer actually bothers with getting each individual release allow listed by every single AV vendor. You can do many people a great favor when encountering such a "problem" example by submitting them to your AV vendor for examination. For almost everything on this forum, it is a false positive.
Topic: How to decode using lame (mp3->wav) in C (Read 244 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to decode using lame (mp3->wav) in C

I want to decode mp3 to pcm using lame on android.
I have found the article below.
https://www.jianshu.com/p/c9feaec59bab
But the problem I have is
samples = hip_decode1_headers(hip, mp3_buffer, mp3_len, pcm_l, pcm_r, &mp3data);
always returns 0 when mp3_buffer I removed the ID3 tag and it contains about 8 mp3 frames

Re: How to decode using lame (mp3->wav) in C

Reply #1
It wants a single frame at a time, I assume.

Re: How to decode using lame (mp3->wav) in C

Reply #2
I tried with 1 frame. it still returns 0.

Re: How to decode using lame (mp3->wav) in C

Reply #3
Maybe this will be helpful?

https://github.com/VFR-maniac/lame/blob/master/frontend/get_audio.c#L2051

Apparently, when decoding the first frame of the file, which may be a LAME/Xing header, you should use hip_decode1_headersB(), which also accepts parameters for the encoder delay and padding fields to be returned to. You should be starting your stream and decoding at least until it reports that the header has been parsed.

 
SimplePortal 1.0.0 RC1 © 2008-2021