c语言开源库lame实现pcm转aac
2017-09-01 本文已影响235人
ttdiOS
c语言开源库lame实现pcm转aac
之前一直想用ffmpeg实现pcm转aac,经过尝试后提示pcm文件不支持,有编译的带mp3lame的ffmpeg结果还是不行,于是就转变方法用了mp3lame这个库去单独实现pcm转aac
编译mp3lame的脚本:https://github.com/wuqiong/mp3lame-for-iOS
##Usage:
just runs the commands in the shell:
git clone https://github.com/wuqiong/mp3lame-for-iOS.git
cd mp3lame-for-iOS
./build-lame-framework.sh
编译后是这样的:
lame.framework后直接将lame.framework拖拽到自己的工程里
导入#import<lame/lame.h>
贴出demo:
工程demo:https://github.com/mrzhao12/mp3lame
使用了iOS自带的AVFoundation-AVAudioRecorder录音pcm,然后用mp3lame将pcm转aac,最后AVFoundation-AVAudioPlayer播放转码后的mp3音频,工程demo:https://github.com/mrzhao12/AVAudioRecorde_lame_pcm_aac
更多资源学习交流群:群号:224110749