Wade's Site

qaac x64 in Linux

Published on

Apple's AAC implementation is my most favourite codec. The official encoder is available only on macOS, but there's a Windows port, qaac (more of a wrapper, really). Andrew has a fantastic guide on how to set up qaac in Linux using Wine. However, it's the 32-bit version, and the iTunes version he uses is over 8 years old. The process is also not as straightforward as it could be.

I've (almost) automated the process with a bash script. This guide assumes you're using Arch Linux. If you're on another distro, you might have to manually set-up a 64-bit Wine prefix. Rest remains the same.

The script needs the following packages: sudo pacman -S wine-staging winetricks 7zip (or just wine). Adapt to your distro.

Download the script from this GitHub gist.

Before you run it, we need one more thing. It's real quick. Go here, paste this in: https://apps.microsoft.com/detail/9pktq5699m62. Find the entry that's like AppleInc.iCloud*x64*.appx, it'll be near the top. Make sure it says x64 and ends with .appx. Right click, copy link address, open the script, and paste it in ITUNES_URL="", inside the quotes.

You're all set. Run the script with bash /path/to/script. It'll download and set everything up automatically. Might take a minute or two depending on your internet speed. If everything goes well, you'll see this at the end:

qaac 2.85, CoreAudioToolbox 7.10.9.0
libsoxconvolver 0.1.0
libsoxr-0.1.3
libsndfile-1.2.2
libFLAC 1.5.0
wavpackdll 5.8.0

Choose yes when it asks you for clean-up, and add the alias to your shell config. You're good to go! If you want to update any of the libraries in the future, simply update the URLs at the top of the script.

Note: CBR mode introduces glitches with CoreAudioToolbox 7.9.8.x and higher. There's no point in using CBR mode, but if you do need it, you'll need the 7.9.7.x version. You'll find it an ancient version of iTunes from 2012.

For usage details, check out the qaac wiki.

You're most likely looking for Apple Music's AAC settings. Use this: qaac -V 127 -q 2 <input> -o <output.m4a>.