Home » Questions » Computers [ Ask a new question ]

What's the simplest way to get .flac music files into iTunes?

What's the simplest way to get .flac music files into iTunes?

I'm looking for a simple way to import .flac files into iTunes, so I can play them on my mac, and when I'm out, my iPhone, and I'm willing to be I'm not the first person to want to do this.

Asked by: Guest | Views: 129
Total answers/comments: 2
Guest [Entry]

"Hmm..

I've stumbled across this the XLD lossless decoder here - it's worked fairly well, but I need to change a few preferences:

If you try a batch conversion,the importer only searches one hierarchy level deep, which often isn't enough, so you need to set the preference to 0 to keep running recursively in a directory.

It does have a handy import into iTunes feature though, which is a nice plus."
Guest [Entry]

"Install the command-line tool ffmpeg via homebrew. You can use it to convert a single file to the Apple Lossless Audio Codec (ALAC) in an M4A (which is supported by iTunes) with:

ffmpeg -i input.flac -c:a alac output.m4a

You can do every file in a directory with:

for f in ./*; do ffmpeg -i ""$f"" -c:a alac ""${f%.*}.m4a""; done

You can do every file recursively (every *.flac in the current directory and all sub-directories) with:

shopt -s globstar
for f in ./**/*.flac; do ffmpeg -i ""$f"" -c:a alac ""${f%.*}.m4a""; done
## or:
find . -name '*.flac' -exec sh -c 'ffmpeg -i ""$0"" -c:a alac ""${0%.*}.m4a""' {} \;"