Skip to content

Instantly share code, notes, and snippets.

@pltb
Created May 8, 2024 12:37
Show Gist options
  • Save pltb/4e75f0f5a69603c7027ee6bba1cb1a8d to your computer and use it in GitHub Desktop.
Save pltb/4e75f0f5a69603c7027ee6bba1cb1a8d to your computer and use it in GitHub Desktop.
Convert FLAC to ALAC with downsampling
#!/usr/bin/env bash
set -e
f2a () {
if [ -z $1 ]; then
echo "usage: $0 dir"
return 1
fi
for file in "$1"/*.flac; do
echo -n "."
ffmpeg -i "$file" -sample_fmt s16p -ar 48000 -acodec alac "${file%.*}.m4a"
done
}
f2a $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment