2019-04-16 13:40:16 +08:00
|
|
|
# Lame MP3 与 Wav 互转
|
|
|
|
|
|
|
|
## 安装
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
sudo apt install lame
|
2019-04-16 13:40:16 +08:00
|
|
|
|
|
|
|
## 使用
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
Fixed bit rate 128kbps encoding:
|
2019-04-16 13:40:16 +08:00
|
|
|
|
|
|
|
lame sample.wav sample.mp3
|
|
|
|
|
2019-11-15 07:33:23 +08:00
|
|
|
Decode:
|
|
|
|
|
|
|
|
lame sample.mp3 sample.wav --decode
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
Fixed bit rate jstereo 128kbps encoding, high quality (recommended):
|
2019-04-16 13:40:16 +08:00
|
|
|
|
|
|
|
lame -h sample.wav sample.mp3
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
Average bit rate 112kbps encoding:
|
2019-04-16 13:40:16 +08:00
|
|
|
|
|
|
|
lame --abr 112 sample.wav sample.mp3
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
Fast encode, low quality (no psycho-acoustics):
|
2019-04-16 13:40:16 +08:00
|
|
|
|
|
|
|
lame -f sample.wav sample.mp3
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
Variable bitrate (use -V n to adjust quality/filesize):
|
2019-04-16 13:40:16 +08:00
|
|
|
|
|
|
|
lame -h -V 6 sample.wav sample.mp3
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
Streaming mono 22.05 kHz raw pcm, 24 kbps output:
|
2019-04-16 13:40:16 +08:00
|
|
|
|
|
|
|
cat inputfile | lame -r -m m -b 24 -s 22.05 -- > output
|
|
|
|
|
2022-04-29 13:20:16 +08:00
|
|
|
Streaming mono 44.1 kHz raw pcm, with downsampling to 22.05 kHz:
|
2019-04-16 13:40:16 +08:00
|
|
|
|
|
|
|
cat inputfile | lame -r -m m -b 24 --resample 22.05 -- > output
|