flac2mp3: fix metadata not actually being copied (because it's piping through a wav)

master
an 2019-05-04 02:43:11 -04:00
parent 106415793d
commit d8a757e573
1 changed files with 5 additions and 7 deletions

View File

@ -1,15 +1,13 @@
fail() {
echo "failed to process $f, exiting"
rm "$wav"
exit 1
}
for f in ./*.flac
do
wav="$(basename "$f" .flac).wav"
flac -s -d "$f"
if (( $? )); then fail; fi
lame --quiet -V0 "$wav"
if (( $? )); then fail; fi
ffmpeg -i "$f" -q:a 0 -vn "$(basename "$f" .flac).mp3"
(( $? )) && fail
echo "$f success"
rm "$f" "$wav"
done
read -ep "success. delete files? [yn] " YN
[[ ${YN,,} == y* ]] && rm ./*.flac