commit a4405bba5837f8f36788a8ec7ea6a281a7dcf186 parent 0fe70c260f283c9111be769180d19092722367a6 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Sun, 5 May 2019 17:05:10 +0200 Improve burn script Diffstat:
M | bin/burn-audio-cd.sh | | | 27 | +++++++++++++++------------ |
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/bin/burn-audio-cd.sh b/bin/burn-audio-cd.sh @@ -24,26 +24,29 @@ fi # convert to mp3 for f in "$@"; do extension="${f##*.}" - outwav="$(basename "$f" "$extension").wav" - - if [ "$extension" = "mp3" ]; then - mpg123 --rate 44100 --stereo --buffer 3072 --resync -w \ - "$outwav" "$f" || \ - lame --decode "$f" "$outwav" - elif [ "$extension" = "m4a" ]; then - faad "$f" + outwav="$(basename "$f" "$extension")wav" + + if [ -e "$outwav" ]; then + echo "$outwav exists, skipping..." else - ffmpeg -i "$f" "$outwav" + if [ "$extension" = "mp3" ]; then + mpg123 --rate 44100 --stereo --buffer 3072 --resync -w \ + "$outwav" "$f" || \ + lame --decode "$f" "$outwav" + elif [ "$extension" = "m4a" ]; then + faad "$f" + else + ffmpeg -i "$f" "$outwav" + fi fi done # burn wav as audio cd (remove -dummy to really burn) #cdrecord -dummy -v -pad speed=1 dev="$drive" -dao -swab *.wav #cdrecord -v -pad speed=1 dev="$drive" -dao -swab *.wav -cdrecord -v -pad speed=1 -dao -swab *.wav +cdrecord -v -pad speed=1 -dao -swab ./*.wav #cdrecord -overburn -v -pad speed=1 dev="$drive" -dao -swab *.wav # clean up and eject -rm *.wav -eject "$drive" +rm ./*.wav exit 0