How to decode mp3 into wav using lame in C/C++?

荒凉一梦 提交于 2020-01-12 13:47:22

问题


I learned how to encode wav into an mp3 using lame_encode_buffer_interleaved from this question: Is there any LAME c++ wraper\simplifier (working on Linux Mac and Win from pure code)?

Now I want to decode the mp3 back into wav. I know there's lame_decode but I don't know how to use it since it requires two pcm buffers (pcm_l and pcm_r). I don't understand how to put them together into a well-formed wav file, because I don't really know how they works.

Now can someone provide a simple working example on decoding an mp3 into a wav using lame in C/C++?

Thanks.


回答1:


Take a look into the lame frontend source code. Start at the lame_decoder() function in the .../frontend/lame_main.c file, it decodes an MP3 file and writes the wave header.



来源:https://stackoverflow.com/questions/7339408/how-to-decode-mp3-into-wav-using-lame-in-c-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!