commit 24c5edc65dfe2656817226072c158e78cca64851
parent 3dbb81aedc7fdad325f03cf805306030c8bbc1ce
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 17 Oct 2019 15:54:18 +0200
Tabs for indent, run cdio without priviledge
Diffstat:
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/.local/bin/burn-audio-cd.sh b/.local/bin/burn-audio-cd.sh
@@ -1,41 +1,38 @@
#!/bin/sh
set -e
-# https://wiki.archlinux.org/index.php/Optical_disc_drive#Burning_an_audio_CD
-
help() {
- echo "$0 FILES"
- echo "converts FILES to wav and burns as an audio cd"
- echo "requires lame, mpg123, faad2, and cdrtools"
+ echo "$0 FILES"
+ echo "converts FILES to wav and burns as an audio cd"
+ echo "requires lame, mpg123, faad2, and cdrtools"
}
-#drive=/dev/sr0
-
if [ $# -lt 1 ]; then
- help
- exit 1
+ help
+ exit 1
fi
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
- help
- exit 0
+ help
+ exit 0
fi
# convert to mp3
for f in "$@"; do
- extension="${f##*.}"
- outwav="$(basename "$f" "$extension")wav"
-
- if [ -e "$outwav" ]; then
- echo "$outwav exists, skipping..."
- else
- ffmpeg -i "$f" "$outwav"
- fi
+ extension="${f##*.}"
+ outwav="$(basename "$f" "$extension")wav"
+
+ if [ -e "$outwav" ]; then
+ echo "$outwav exists, skipping..."
+ else
+ ffmpeg -i "$f" "$outwav"
+ fi
done
# burn wav as audio cd
if type cdio >/dev/null 2>&1; then
- doas cdio tao -a -s auto ./*.wav
+ cdio tao -a -s auto ./*.wav
+ cdio eject
else
cdrecord -v -pad speed=1 -dao -swab ./*.wav
fi