LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

afconvert

macOS audio file format converter

TLDR

Convert audio file to AAC
$ afconvert -f m4af -d aac [input.wav] [output.m4a]
copy
Convert to ALAC (Apple Lossless)
$ afconvert -f m4af -d alac [input.wav] [output.m4a]
copy
Convert to AIFF
$ afconvert -f AIFF -d BEI16 [input.mp3] [output.aiff]
copy
Set bit rate for AAC encoding
$ afconvert -f m4af -d aac -b [128000] [input.wav] [output.m4a]
copy
Convert with VBR strategy
$ afconvert -f m4af -d aac -s 3 -b [128000] [input.wav] [output.m4a]
copy
List supported formats
$ afconvert -hf
copy

SYNOPSIS

afconvert [options] input [output]

DESCRIPTION

afconvert is a macOS command-line tool for converting between audio file formats. It supports all audio formats handled by Core Audio, including WAV, AIFF, MP3, AAC, ALAC, CAF, and more. If no output file is specified, the name is generated automatically and saved in the same directory as the input.The tool provides access to Apple's audio codecs and can perform sample rate conversion, bit depth conversion, and channel remapping along with format conversion.

PARAMETERS

-f, --file format

Output file format (m4af, WAVE, AIFF, caff, etc.).
-d, --data format
Audio data format (aac, alac, BEI16, LEF32, etc.). Can include sample rate and format flags.
-b, --bitrate rate
Total bit rate in bits per second for compressed formats.
-c, --channels number
Number of output channels.
-l, --channellayout tag
Channel layout tag.
-q, --quality quality
Codec quality (0-127, higher is better).
-r, --src-quality quality
Sample rate converter quality (0-127, default: 127).
--src-complexity complexity
Sample rate converter complexity (line, norm, bats).
-s, --strategy strategy
Bitrate allocation strategy (0=CBR, 1=ABR, 2=VBR_constrained, 3=VBR).
-o filename
Specify output file path.
--dither algorithm
Dither algorithm (1 or 2).
--mix
Enable channel downmixing.
-v, --verbose
Display progress information.
-h, --help
Display help information.
-hf, --help-formats
List all supported file and data formats.

CAVEATS

This tool is macOS-only. Some format conversions may be lossy. AAC encoding quality varies with bit rate settings. Not all format combinations are valid. Use -hf to see which formats are supported on your system.

HISTORY

afconvert has been part of macOS since Mac OS X, providing command-line access to the same audio conversion capabilities used by iTunes and other Apple applications.

SEE ALSO

ffmpeg(1), sox(1), lame(1)

Copied to clipboard
Kai