Audacity's manual publishes a working command for exporting Apple Lossless, and it ships with a trap in the file name. The route is not a format in the export dropdown — it is the (external program) option, which hands your audio to FFmpeg on the command line.
The trap is worth reading twice before you type anything: the extension you enter has to be .m4a, not .alac. Get that wrong and you end up with a file most players will not open, which looks like a failed export but is really a naming problem.
The command
Audacity's Exporting to an external program page gives this example verbatim, introducing it as "an example of a command to FFmpeg in an arbitrary location on Windows, forcing the exported codec to Apple lossless." The same sentence continues with the instruction that matters most:
"When specifying the file name above the command, add the extension ".m4a" (without quotes), not .alac:"
"E:\FFmpeg for Audacity\ffmpeg.exe" -i - -acodec alac "%f"You reach the box you paste that into from the same page's entry line: "Accessed by: File > Export Audio then choosing (external program) from the Format dropdown menu."
The manual describes what this mode is for in one sentence — "This sends audio via a command-line to an external program, either for processing or for encoding as an audio file" — and spells out why you would bother: "With this you can export using the installed LAME MP3 encoder or FFmpeg encoder with additional parameters not supported in the options dialogs in the Export Audio Dialog."
Apple Lossless is a good example of exactly that. Audacity's file formats comparison table lists rows for WAV, AIFF, FLAC, M4A (AAC), WMA v2, AC3, MP2, MP3, Ogg Vorbis and GSM 6.10 WAV — there is no ALAC row on it. The command line is the route the manual documents.
What each part does
The quoted path. The manual is explicit about when you can get away with just typing ffmpeg: "Accessing the LAME or FFmpeg command-line program with just the "lame" or "ffmpeg" command (as shipped with Audacity) only works on Windows and Linux, assuming LAME or FFmpeg are installed on the system in the standard location." On Windows it adds a second condition — "this requires that you used the LAME or FFmpeg EXE installer and did not change the installation directory." Otherwise: "the full path to the command-line program must be given. The path must be enclosed inside quotes if there are any spaces in the path." That is why the example path in the official command sits inside double quotes; it contains spaces.
-acodec alac. This is the part the manual glosses as "forcing the exported codec to Apple lossless." The codec is chosen here, in the command — not by the file name.
"%f". Audacity's own placeholder, and the reason the extension rule exists at all. The manual: "The "%f" command passes the file name and extension entered in the Export Audio dialog as the output file of the external program." So whatever you type in the dialog is handed to FFmpeg as the output file, extension included — which is why the manual tells you to type .m4a there.
The same split shows up on the Custom FFmpeg Export page, which tells you to "add .wav extension for WAV format, irrespective of the codec chosen for the WAV file." The codec you pick and the extension you type are separate decisions, and the manual pins the extension to the format in both cases.
Variations
On Mac, use a full path. The manual's Mac example uses the lossy AAC codec, but it shows the path shape you need: /Applications/FFmpeg_for_Audacity_on_OSX/ffmpeg -i - -metadata genre="pop" -metadata author="Jo S" "%f". Swap the codec flag for the ALAC one from above.
Write metadata in the command. You have to, because the manual warns: "Metadata Editor does not appear before command-line exports, nor are any tags it already contains passed to the external application. Use the appropriate command for your application to write metadata to the output file as described below." The -metadata pairs in the Mac example are the official demonstration of that.
Other codecs, same mechanism. The page also documents ffmpeg -i - -acodec mp2 -ab 256000 "%f" for 256 kbps MP2, and two commands using -strict experimental to reach the native FFmpeg AAC encoder — which the manual says "is required to export more than stereo, up to a maximum of 6 channels." Our write-up of Audacity's channel limits on export covers where those ceilings come from.
If you would rather pull a lossless audio track out of a video file than route a project through FFmpeg by hand, do it in the browser:
Try it right here
Runs in your browser. Your file is not uploaded anywhere.
That runs locally in the page, so nothing is uploaded. The rest of the format converters — including M4A to MP3 when you need a lossy copy afterwards — are listed on all Clapr tools.
Troubleshooting
The shipped default command fails on Mac. Audacity ships two defaults, lame - "%f" and ffmpeg -i - "%f", and the manual flags them as "these only work on Windows and Linux not on Mac." It repeats the point on the same page: "On Mac the shipped commands for "lame" and "ffmpeg" do not work, trying them will simply generate an error message." The fix it gives is blunt — "Accordingly it is necessary to download a version of LAME or FFmpeg." For where to get FFmpeg, check the official documentation; Audacity's FAQ notes only that "because of software patents, Audacity cannot include the FFmpeg software or distribute it from its own websites," and points at its support site for the install.
You see no error window. There is a checkbox for that: "Show output If checked, a Command Output window in Audacity will display a success or failure message from the external program. If unchecked, the window will only appear in the case of an error message." Turn it on while you are still getting the command right.
Exporting multiple files does nothing. The Export Multiple page is specific: "When exporting using (external program), Audacity will not export the files, and will show an error message, unless you add an appropriate extension to the (external program) Command or to the file names (the labels or tracks)." Same extension rule, applied per label or track name.
The output is empty or unplayable. Audacity's export formats page warns that "some exports might result in zero-byte or invalid files if FFmpeg does not support the combination chosen." The manual also gives a clean way to isolate the cause: "One way to test if there is a problem in the Audacity implementation of FFmpeg is to use a command-line version of FFmpeg separately to perform the same task. If it fails in FFmpeg, then Audacity has the same limitation."
A track is missing from the file. Nothing to do with ALAC: "When using Export Audacity will only export tracks that are not grayed-out by use of the Mute or Solo buttons in the tracks' Track Control Panels."
FAQ
Why does the file have to be named .m4a and not .alac?
Because the manual says so, verbatim: add ".m4a" (without quotes), not .alac. The name you type is passed straight through as the output file via %f, and it is what tells FFmpeg which container to write.
Do I need FFmpeg installed to export Apple Lossless from Audacity? Yes — this route runs FFmpeg as an external program, and Audacity does not ship it. The manual states that patents prevent Audacity from including or distributing FFmpeg, and directs you to its support site for installation; check the official documentation for the current steps.
Can I set Apple Lossless from the Export Audio dropdown instead?
The manual documents Apple Lossless through the (external program) command shown above. There is also a Custom FFmpeg exporter, which "lets you export a specific codec in a specific format container" — but its available options "depend entirely on the options with which your copy of FFmpeg has been compiled."
Will my Metadata Editor tags end up in the ALAC file?
No. The manual says Metadata Editor does not appear before command-line exports and its existing tags are not passed to the external application. Write them into the command with -metadata instead.
Does Audacity remember the command so I do not have to retype it? It keeps a short history. The manual: "The "Command" box holds up to the last 12 items entered. When a thirteenth command is entered, the first one (at the bottom of the list) is removed." Once your ALAC line works, it stays in that dropdown until twelve newer commands push it out. More command-line recipes live in the FFmpeg guides hub.
Commands and quotes taken from the Audacity Manual pages for Exporting to an external program and Custom FFmpeg Export Options, checked 16 September 2026. Verify against the current manual before relying on them.