From Audacity Wiki
Jump to: navigation, search
Gale 17Apr15: ToDo-211 Libsamplerate and libresample have been removed from lib-src. James 19Apr15 Yes. The comparison tables are still interesting/informative. It is (or will be) history of interest to developers.
The SoX Resampler library libsoxr performs fast, high-quality one-dimensional sample rate conversion. Audacity started using libsoxr from version 2.0.3 onwards.
  • As of 2.0.3, libsoxr is the default resampling library in releases and when compiling Audacity, instead of the former libresample. Either libresample or libsamplerate can be enabled at compile time as sole resampling library instead of libsoxr. Libsamplerate should not be enabled if the build enables VST plug-in support, due to licensing reasons.
  • All three libraries support both constant-rate and variable-rate resampling (currently only used in Time Tracks). Libsoxr's variable-rate support is of recent implementation so may be subject to further development.

Four SoX Resampler quality levels are available for constant-rate resampling in Audacity; which one to use in different circumstances may be selected in the Preferences/Quality menu. Note that the names assigned to these levels differ from those used by the 'sox' command-line utility; equivalent names are shown in the following table:

Quality level names
Audacity sox 'rate'
Low Quality Quick
Medium Quality Low
High Quality High
Best Quality Very high

See the 'rate' effect in the SoX manual for details (frequency response, etc.) of each of these quality levels.

Sample rate conversion in Audacity 2.0.3 ("Best Quality") can be compared with SoX "Very high" and numerous other audio applications in the graphs at at Note that in the "passband" and "transition" graphs, SoX's "steep filter" was used, which option is not available in libsoxr in Audacity. This probably accounts for those two SoX graphs being closer to the "ideal" filter.

For variable-rate resampling, libsoxr uses a single, dedicated quality level. This is selected automatically by Audacity when performing a task that requires it.

For comparison purposes, the following table attempts to place in order of increasing quality, current resampling qualities (with libsoxr), and those with resamplers available in previous/other configurations of Audacity:

Resampler libraries quality comparison
Libsoxr Libresample Libsamplerate Filter-order/
ZOH Interpolator 0/-
Linear Interpolator 1/-
Low Quality 3/-
Fast Sinc Interpolation -/14
High-quality Sinc Interpolation -/15
Medium Quality Fastest Sinc Interpolator -/16
(variable-rate) -/20
High Quality Medium Sinc Interpolator -/20
Best Sinc Interpolator -/24
Best Quality -/28
Personal tools

Donate securely by PayPal, using your credit card or PayPal account!