นี่คือสคริปต์ที่ฉันใช้ (การอ้างอิงของมันอยู่ในความคิดเห็น):
#!/bin/bash
# ll-cue2mp3-320.bash
# cue and audio file basename must be the same. Usage:
# ll-cue2mp3-320.bash `basename *cue .cue`
# It makes mp3 folder in the dir containing rip, put splits
# there in the format 'trackNumber - trackTitle', and convert splits
# to mp3s. Tags are not transfered to the newly born mp3s.
#
# You can specify the this format with a second arg. Default value
# is '%n - %t'. Other options (them are lltag options):
#
# %a means ARTIST
# %t means TITLE
# %A means ALBUM
# %n means NUMBER
# %g means GENRE
# %d means DATE
# %c means COMMENT
# %i means that the text has to be ignored
# %F means the original basename of the file
# %E means the original extension of the file
# %P means the original path of the file
#
# Dependences: lltag, lame, cuetools, shntool, flac, wavpack,
# parallel, ape support (if you're going to split ape files)
# Don't forget to put input args in quotes, e.g:
# ll-cue2mp3-320 "name of the cue file" "%a - %t"
#
# TODO:
# convert tags to utf-8 - if they are not
# parsing 1st arg:
fl="$1"
if [ -e "$fl".flac ]; then
ex="flac"
elif [ -e "$fl".ape ]; then
ex="ape"
else [ -e "$fl".wv ]
ex="wv"
fi
# parsing 2nd arg:
frmt="$2"
frmt=${2:-"%n - %t"}
# splitting the dump:
mkdir mp3
cuebreakpoints "$fl".cue | shnsplit -o flac -d mp3 -a split "$fl".$ex && \
cuetag "$fl".cue mp3/split*\.flac
cd mp3
# renaming splits basing on tags:
for i in `ls`; do
lltag --yes --no-tagging --rename "$frmt" $i
done
# converting splits to mp3:
parallel -j+0 flac -d {} ::: *\.flac
parallel -j+0 lame --cbr -b 320 -q 0 {} ::: *\.wav
find . -name "*.flac" | parallel -j+0 rm
find . -name "*.wav" | parallel -j+0 rm
rename 's/\.wav//' *
# done!
cuesplitter
ก็ใช้ได้เช่นกัน