Convert Flac Audio to Alac format

less than 1 minute read

Convert Flac Audio to Alac format

If you are inteterested in lossless audio you probably have heard of the flac format. Apple Music uses a different lossless format called alac. I wanted to convert flac files in bulk to the alac format so I used the shell and the afconvert command which is builtin to Mac.

The following shell command will convert multiple flac audio files in the current directory to the Apple native format alac. It will then create a directory called flac in the current directory and move the original flac files to that directory. Once completed all of the flac files in the current directory will be the native Apple format and can be played with Apple Music on your iPhone or whatever.

DESTINATION="flac"; mkdir -p "$DESTINATION"; export IFS=$'\n'; for x in `ls *.flac`; do afconvert -v -f m4af -d alac $x ${x%flac}m4a; mv -v "$x" "$DESTINATION"; done

Anyways, hope this helps.