Convert music files from FLAC to ALAC
If you store your music files as FLAC and you own an iPhone or an iPad, you know your phone cannot read these files with the Music application… Indeed, Apple uses its format to store music: ALAC. To play your music on your device, you need to convert the files from FLAC to ALAC. I haven't found a good guide for a free solution on the internet to do that, so I've made my own 😃
#What are FLAC and ALAC?
FLAC, Free Lossless Audio Codec, is a free lossless audio codec. FLAC can compress audio to about 50~60% without any quality loss. This format has been widely accepted by many Hi-Fi systems and audiophiles.
ALAC, Apple Lossless Audio Codec, is an audio compressing format, developed by Apple for lossless data compression of digital music. After initially keeping it proprietary from its inception in 2004, in late 2011 Apple made the codec available open-source and royalty-free.
Both formats use a lossless compression algorithm. Thus, you can convert from one format to the other without losing data. It's just another way to store the same data.
#Method 1: Using Foobar2000
If you use foobar2000, you can download the Free Encoder Pack. Then, you can convert all your playlist from foobar2000.
Select the files you want to convert
Select the output format
Click the "convert" button and select the destination folder
#Method 2: Works on Windows, Linux and Mac
Before going into the conversion scripts, you need to download the following tools:
Move flac.exe
and ffmpeg.exe
in a folder, for instance in C:\tools\
. It will be easier to use from the scripts.
Copy your FLAC files in a folder
Start PowerShell Core
Convert FLAC files to WAV
PowerShell$folder = "d:\demo\" Get-ChildItem -Recurse "$folder\*.flac" | ForEach-Object { & C:\tools\flac.exe -d --force --silent $_.FullName }
Convert WAV files to ALAC
PowerShell$folder = "d:\demo\" Get-ChildItem -Recurse "$folder\*.wav" | ForEach-Object { $filename = [System.IO.Path]::ChangeExtension($_.FullName, ".m4a") & C:\tools\ffmpeg.exe -hide_banner -loglevel panic -i $_.FullName -acodec alac -sample_fmt s16p $fileName }
Remove FLAC and WAV files
PowerShellGet-ChildItem -Recurse "$folder\*.wav" | Remove-Item Get-ChildItem -Recurse "$folder\*.flac" | Remove-Item
Now you folder only contains ALAC files:
You can now use the application you want to copy your music files to your iPhone or iPad.
Do you have a question or a suggestion about this post? Contact me!