#!/bin/sh
set -xe
alias flac_encode="flac -e --best --delete-input-file"
doas chown sdk /dev/rcd0* /dev/cd0*
cdio cdrip
for i in *.wav;
do
    flac_encode "$i" -o "${i%%.wav}.flac";
done
picard *.flac
cdio eject
