Skip to content

Instantly share code, notes, and snippets.

@turbulentie
Last active July 9, 2021 10:55
Show Gist options
  • Save turbulentie/50b199d54dd9ad0fb480aedb166924b9 to your computer and use it in GitHub Desktop.
Save turbulentie/50b199d54dd9ad0fb480aedb166924b9 to your computer and use it in GitHub Desktop.
convert DSD to FLAC using dsf2flac bin
#!/bin/bash
# -----------------------------------------------------------------------------
# dsd2flac: convert DSD to FLAC using dsf2flac bin
# -----------------------------------------------------------------------------
function dsd2flac() {
shopt -s nullglob # Sets nullglob
OUTDIR="${PWD##*/} [FLAC 24-88200]"
rm -f *.flac && rm -rf "$OUTDIR"
for f in *.dff *.dsf ; do
dsf2flac -1 -s 6 -i "$f" "$f.flac"
if [[ $(find . -maxdepth 1 -iname '*.flac' 2>/dev/null | wc -l) != 0 ]]; then
mkdir -p "$OUTDIR"
mv *.flac "$OUTDIR"
fi
done
if [[ "$f" == "" ]]; then
echo "DSD files not found"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment