soxr
High quality, one-dimensional sample-rate conversion library
What it is and what it does
soxr is a Python wrapper around libsoxr, a high-quality audio resampling library. It converts audio signals from one sample rate to another while maintaining audio fidelity. The package supports both simple one-shot resampling via a single function call and streaming resampling for real-time or very long signals via a ResampleStream class. Input and output are numpy arrays; the library handles mono and multi-channel audio and preserves the input data type (float32, float64, int16, or int32).
The package is actively maintained, supports Python 3.9 and later, and offers pre-built wheels for common platforms (macOS, Linux, Windows) and architectures (x86_64, ARM). It is copyleft-licensed under LGPL-2.1-or-later, following libsoxr's license. According to the project's benchmarks, soxr is among the fastest Python resamplers available, outperforming scipy.signal.resample, resampy, and other alternatives on CPU time for typical audio workloads.
Use it for:
- Downsampling or upsampling audio files to match target sample rates in audio processing pipelines.
- Real-time audio streaming applications that need to convert between different input and output sample rates.
- Digital signal processing workflows requiring high-quality resampling with minimal artifacts.
- Audio feature extraction or machine learning preprocessing where sample rate normalization is needed.
- Building audio codecs or transcoding tools that must resample between incompatible formats.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Performs high-quality sample-rate conversion (resampling) for audio signals, supporting both one-shot and streaming modes via a Python wrapper around libsoxr.
Yes. soxr is production-stable, actively maintained, and offers superior resampling quality and speed compared to common alternatives. Medium install friction is manageable via pre-built wheels. LGPL-2.1-or-later licensing is suitable for open-source projects but requires review for proprietary use. Install if you need high-quality audio resampling; avoid only if copyleft licensing is incompatible with your project.
Install
soxr on PyPI
pip
pip install soxruv
uv add soxrpoetry
poetry add soxrInstalling soxr
Before you install
Medium install friction due to compiled wheels; pre-built binaries available for Python 3.9+ across macOS (Intel and ARM), Linux, and Windows. Repository is actively maintained with recent commits.
License in practice
Licensed under LGPL-2.1-or-later (copyleft); derivative works and distributions must comply with copyleft obligations. Suitable for open-source projects; proprietary use requires careful license review.
Quickstart
import soxr
import numpy as np
# One-shot resampling
y = soxr.resample(x, 48000, 16000) # x is numpy array, returns resampled array
# Streaming resampling
rs = soxr.ResampleStream(44100, 16000, 1, dtype='float32')
y_chunk = rs.resample_chunk(x, last=False)
Requires numpy; input must be numpy.ndarray or convertible to float32, float64, int16, or int32.
Verify before relying
- Whether the package supports real-time latency constraints or is suitable for live audio applications.
- Memory overhead and performance characteristics for very long signals or high channel counts.
- Availability and stability of conda-forge builds relative to PyPI wheels.
Package facts
| License | LGPL-2.1-or-later (copyleft) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 103 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,225,603/month — #1,407 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: soxr-1.1.0-cp310-cp310-macosx_10_14_x86_64.whl; soxr-1.1.0-cp310-cp310-macosx_11_0_arm64.whl; soxr-1.1.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; soxr-1.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; soxr-1.1.0-cp310-cp310-win_amd64.whl; soxr-1.1.0-cp311-cp311-macosx_10_14_x86_64.whl; soxr-1.1.0-cp311-cp311-macosx_11_0_arm64.whl; soxr-1.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; soxr-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; soxr-1.1.0-cp311-cp311-win_amd64.whl; soxr-1.1.0-cp312-abi3-macosx_10_14_x86_64.whl; soxr-1.1.0-cp312-abi3-macosx_11_0_arm64.whl; soxr-1.1.0-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; soxr-1.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; soxr-1.1.0-cp312-abi3-win_amd64.whl; soxr-1.1.0-cp314-cp314t-macosx_10_15_x86_64.whl; soxr-1.1.0-cp314-cp314t-macosx_11_0_arm64.whl; soxr-1.1.0-cp314-cp314t-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; soxr-1.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; soxr-1.1.0-cp314-cp314t-win_amd64.whl
Keywords: audio resampling, samplerate conversion, SRC, signal processing, resampler
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
samplerateWraps libsamplerate (Secret Rabbit Code) to…
permissive · top 15,000 on PyPI
soxPython wrapper that exposes SoX audio…
permissive · top 5,000 on PyPI
doppler-dspProvides a C99 digital signal processing…
permissive · top 15,000 on PyPI
audiofileReads and writes audio files across formats…
permissive · top 15,000 on PyPI
python-stretchPitch-shifts and time-stretches audio using the…
permissive · top 15,000 on PyPI
audiolabaudiolab loads, processes, and saves audio…
permissive · top 15,000 on PyPI
juliusJulius provides differentiable, GPU-accelerated…
permissive · top 5,000 on PyPI
soundfileReads and writes audio files in formats like…
permissive · top 1,000 on PyPI
stftpitchshiftShifts the pitch and timbre of audio signals…
permissive · top 15,000 on PyPI