Skip to content

Instantly share code, notes, and snippets.

@pltb
Last active May 8, 2024 15:37
Show Gist options
  • Save pltb/244899d900a1b0305467f50e32133cc3 to your computer and use it in GitHub Desktop.
Save pltb/244899d900a1b0305467f50e32133cc3 to your computer and use it in GitHub Desktop.
FLAC -> ALAC convesion script with downsampling to 16bit/44100kHz
#!/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 -map 0:a -ar 44100 -acodec alac "${file%.*}.m4a"
done
}
f2a $1
@pltb
Copy link
Author

pltb commented May 8, 2024

Was first using this script, then changed it to only use afconvert, but then decided to simply use ffmpeg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment