Convert Audio with macOS's Built-in afconvert
Core Audio's afconvert handles WAV to M4A/AAC and many other conversions without installing ffmpeg.
Run `afconvert -f m4af -d aac input.wav output.m4a` to convert a WAV file to AAC in an M4A container.
01Command
Command
$ afconvert -f m4af -d aac input.wav output.m4a02What it does
afconvert requires two flags in a fixed order: -f selects the container (m4af, caff, wave, aiff) and -d the data format (aac, alac for lossless, pcm variants). It powers the conversion behind many Apple apps, so codec support is exhaustive — `afconvert -hf` lists every high-grade format pair. Common extras: -b 192000 to set the AAC bitrate and --soundcheck-generate for gapless metadata.
03Risk
!Warning: Flag order matters — swapping -f and -d positions is the classic reason afconvert reports 'Error: cannot determine format'.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- afconvert — convert audio files (macOS)Evidence: Documents the -f file format and -d data format flags, plus a table of supported containers like m4af and codecs like aac.
Last verified: 2026-09-17 · Category: Media