#### 前言
本demo是使用开源项目lame来将PCM数据编码成MP3数据。(环境:x86_64 Ubuntu16.04 64位)
### 1、编译使用
**lame的编译:**(源码下载地址:[https://sourceforge.net/projects/lame/files/lame/](https://sourceforge.net/projects/lame/files/lame/))
```bash
tar xzf lame-3.100.tar.gz
cd lame-3.100/
./configure --prefix=$PWD/_install
make
make install
```
**本demo的编译与使用:**
```bash
$ make clean && make
$
$ ./pcm2mp3
Usage:
./pcm2mp3 <in pcm file> <smaplerate> <channels> <out mp3 file>
Examples:
./pcm2mp3 audio/test1_44100_16bit_stereo.pcm 44100 2 out1_44100_stereo.mp3
./pcm2mp3 audio/test2_22050_16bit_stereo.pcm 22050 2 out2_22050_stereo.mp3
./pcm2mp3 audio/test3_22050_16bit_mono.pcm 22050 1 out3_22050_mono.mp3
./pcm2mp3 audio/test4_8000_16bit_mono.pcm 8000 1 out4_8000_mono.mp3
```
### 2、参考文章
- [Is there any LAME C++ wrapper\_simplifier (working on Linux Mac and Win from pure code)\_ - Stack Overflow](https://stackoverflow.com/questions/2495420/is-there-any-lame-c-wrapper-simplifier-working-on-linux-mac-and-win-from-pure)
- [使用libmp3lame库编码mp3\_太上绝情的博客-CSDN博客\_libmp3lame.mhtml](https://blog.csdn.net/bjrxyz/article/details/73435407)
- [c++ - 使用 libmp3lame\_liblame\_lame 将单声道 PCM 文件编码为 MP3 - IT工具网.mhtml](https://www.coder.work/article/1215758)
### 附录(demo目录架构)
```bash
$ tree
.
├── audio
│ ├── out1_44100_stereo.mp3
│ ├── out2_22050_stereo.mp3
│ ├── out3_22050_mono.mp3
│ ├── out4_8000_mono.mp3
│ ├── test1_44100_16bit_stereo.pcm
│ ├── test2_22050_16bit_stereo.pcm
│ ├── test3_22050_16bit_mono.pcm
│ └── test4_8000_16bit_mono.pcm
├── docs
│ ├── c++ - 使用 libmp3lame_liblame_lame 将单声道 PCM 文件编码为 MP3 - IT工具网.mhtml
│ ├── Is there any LAME C++ wrapper_simplifier (working on Linux Mac and Win from pure code)_ - Stack Overflow.mhtml
│ └── 使用libmp3lame库编码mp3_太上绝情的博客-CSDN博客_libmp3lame.mhtml
├── include
│ └── lame
│ └── lame.h
├── lib
│ └── libmp3lame.a
├── main.c
├── Makefile
└── README.md
```
没有合适的资源?快使用搜索试试~ 我知道了~
audio-pcm2mp3-with-libmp3lame-master.zip
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共17个文件
pcm:4个
mp3:4个
mhtml:3个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
需积分: 5 0 下载量 155 浏览量
2024-07-08
19:12:20
上传
评论
收藏 8.65MB ZIP 举报
温馨提示
使用开源项目lame来将PCM数据编码成MP3数据。
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![a](https://img-home.csdnimg.cn/images/20210720083646.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 17 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/cf8480693b1c46c8b5462994bb425a77_weixin_44498318.jpg!1)
R-QWERT
- 粉丝: 1996
- 资源: 31
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)