Linux下常见音频格式转换工具

Linux下常见音频格式转换

常见转换工具

MP3 相关工具: lame
OGG 相关工具: vorbis-tools
APE 相关工具: mac
FLAC 相关工具: flac
WAV 相关工具: shntool
BIN/CUE镜像分割: bchunk

Ubuntu下安装方式

lame

Bash
sudo apt install lame

vorbis-tools

Bash
sudo apt install vorbis-tools

mac

Bash
sudo add-apt-repository ppa:robert-tari/main
sudo apt update
sudo apt install mac

可以参考这个网站 https://tari.in/www/software/mac/

flac

Bash
sudo apt install flac 

shntool

Bash
sudo apt install shntool 

bchunk

Bash
sudo apt install bchunk


转换方式

MP3 和 WAV 之间相互转换

mp3 -> wav

Bash
lame --decode <输入_mp3文件> <输出_wav文件>

wav -> mp3

Bash
lame -b <比特率> <输入_wav文件> <输出_ogg文件> 
shntool conv -o "cust ext=mp3 lame -b <比特率> - %f" <输入_wav文件>

OGG 和 WAV 之间相互转换

ogg -> wav

Bash
oggdec <输出_ogg文件> -o <输入_wav文件>

wav -> ogg

Bash
oggenc -b <比特率> <输入_wav文件> -o <输出_ogg文件> 

APE 和 WAV 之间相互转换

ape -> wav

Bash
mac <输入_ape文件> <输出_wav文件> -d

wav -> ape

Bash
mac <输入_wav文件> <输出_ape文件> -c <压缩比率, 默认为 2000>

FLAC 和 WAV 之间相互转换

flac -> wav

Bash
flac -d <输入_flac文件> -o <输出_wav文件>

wav -> flac

Bash
flac <输入_wav文件> <输出_flac文件> -<压缩比率 1-8 , 默认为 5>

分割APE/CUE镜像

Bash
# 先解码成WAV格式 
mac CDImage.ape CDImage.wav -d 

# 进行切割
bchunk -w CDImage.wav CDImage.cue output 
# OR
shnsplit -f CDImage.cue CDImage.wav

# 也可以直接切割 
#           输入的CUE文件  输出文件格式
shnsplit -f CDImage.cue   -i ape 

# 切割并转换到FLAC
#           输入的CUE文件  输入文件格式  输出文件格式  输入文件
shnsplit -f CDImage.cue   -i ape      -o flac     CDImage.ape 

APE和FLAC 互相转换

Bash
shnconv -i ape -o flac CDImage.ape 
shnconv -i flac -o ape CDImage.flac 
qrcode

创建时间:2021-09-16 12:34:00

最后修改:2023-02-13 06:01:52