audioconv is a bash script that batch-converts MP3 files to M4A (AAC) on macOS. It uses afconvert — Apple’s built-in audio converter — so there’s nothing extra to install. Point it at a folder full of MP3s and it encodes them all to AAC in M4A containers.
How it works
audioconv finds every MP3 in a directory, converts each one to M4A using Apple’s AAC encoder, and reports progress as it goes. It skips files that have already been converted, cleans up partial outputs on failure, and gives you a summary at the end.
You get full control over the encoding strategy — CBR, ABR, constrained VBR, or true VBR — plus bitrate and codec quality settings. The defaults (128kbps, VBR, max quality) are sensible for most music libraries, but everything is tunable.
Usage
# Convert all MP3s in a folder
audioconv ~/Music
# Recursive, higher bitrate
audioconv -r -b 256000 ~/Music
# Recursive + delete originals after conversion
audioconv -r --delete-originals ~/Music/Albums
# Dry run — see what would be converted without doing it
audioconv -d -r ~/Music
Options
| Flag | Description |
|---|---|
-r, --recursive | Traverse subdirectories |
-b, --bitrate <bps> | Bitrate in bits per second (default: 128000) |
-q, --quality <0-127> | Codec quality (default: 127 — maximum) |
-s, --strategy <0-3> | 0=CBR, 1=ABR, 2=VBR constrained, 3=VBR (default: 3) |
--delete-originals | Remove original MP3 after successful conversion |
-d, --dry-run | Show what would be converted without converting |
-v, --verbose | Show afconvert output |
Encoding strategies
The --strategy flag controls how the encoder allocates bits:
- 0 — CBR (Constant Bit Rate): Every frame gets the same bitrate. Predictable file sizes, but wastes bits on silence and simple passages.
- 1 — ABR (Average Bit Rate): Averages out to the target bitrate over time. A middle ground.
- 2 — VBR constrained: Variable bitrate that won’t exceed the target. Good when you need a file size ceiling.
- 3 — VBR (default): True variable bitrate. Allocates more bits to complex passages and fewer to simple ones. Best quality-to-size ratio.
Dependencies
None beyond macOS itself. The script uses afconvert, which ships with every Mac. No Homebrew packages, no ffmpeg, no Python — just bash and a tool Apple already put on your machine.
Why we built it
Sometimes you just want to convert a music library from MP3 to AAC without installing ffmpeg or firing up a GUI app. macOS has a perfectly good AAC encoder built in — afconvert — but its interface is fiddly and not designed for batch work. audioconv wraps it in a sensible CLI with progress reporting, skip-if-exists logic, and a dry-run mode so you can see what’ll happen before committing.