Sample rate conversion - nu774/qaac GitHub Wiki

Sample rate conversion is done on the following cases:

  • You specified --rate with explicit sampling rate (in Hz). (--rate 44100 or something)
  • You are encoding to AAC and source rate is not allowed by spec, or encoder has decided downsampling.

By default, qaac works as if --rate=keep specified. --rate keep tries to keep the same sampling rate as source.

On the other hand, --rate auto lets encoder choose the optimal sampling rate depending on the bitrate given. This changes the behavior when the target bitrate is low, and --rate auto also allows you to specify lower bitrate than for --rate keep.

qaac chooses SoX rate converter of libsoxr by default. Quality/performance-wise, it's the best sample rate converter available for qaac (known to be efficient and flawless). When libsoxr DLL is not present, or if you specify --native-resampler, qaac uses CoreAudio sample rate converter.

CoreAudio resampler (--native-resampler)

--native-resampler can take optional arguments to control sample rate converter complexity and quality. Without optional arguments, codec default sample rate converter is used. If arguments specified, qaac will use dedicated, configurable AudioConverter for sample rate conversion. Unlike other options, --native-resampler and it's arguments are delimed by a '=', and you cannot use a whitespace here. Complexity is one of line,norm,bats. Quality is an integer between 0 and 127. Complexity and quality must be delimited by a ',' (comma).

Sample rate converter complexity

line linear (Worst, and included only for the completeness. Don't use this)
norm normal
bats mastering (Best, but quite slow)

Example

--native-resampler Use codec default converter
--native-resampler=bats,127 Complexity:bats(mastering) and Quality:127(highest)
--native-resampler=bats Complexity:bats. Default quality is chosen.
--native-resampler=96 Quality:96. Default complexity is chosen.
⚠️ **GitHub.com Fallback** ⚠️