I use Apple Music for most of my music collection. I also buy rare or remastered CD releases that are sometimes distributed as FLAC files, which Apple Music does not support. I convert them to Apple Lossless Audio Codec (ALAC) before importing them into my library.
Install FFmpeg with Homebrew:
brew install ffmpegInstall FFmpeg with Homebrew
Open the directory containing the FLAC files and run:
for file in *.flac; do
ffmpeg -i "$file" -acodec alac -vcodec copy "$(basename "$file" .flac).m4a"
done
mkdir flac alac
for file in *.flac; do
mv "$file" flac/
done
for file in *.m4a; do
mv "$file" alac/
doneConvert FLAC files to ALAC and organize the output
The script converts each FLAC file to ALAC in an .m4a container. It moves the source files to flac and the converted files to alac:
Drag the alac directory into Apple Music to import the album and upload its tracks to the cloud.