High quality, one-dimensional sample-rate conversion library
Maintained. Last release 7 months ago, commits in 8 of the last 26 weeks. Weaker on release cadence and contributor spread.
pip install soxrPython-SoXR
High quality, one-dimensional sample-rate conversion library for Python.
- Homepage: https://github.com/dofuuz/python-soxr
- Documentation: https://python-soxr.readthedocs.io
- Release Notes: https://github.com/dofuuz/python-soxr/releases
- PyPI: https://pypi.org/project/soxr/
Keywords: Resampler, Audio resampling, Samplerate conversion, DSP(Digital Signal Processing)
Python-SoXR is a Python wrapper of libsoxr.
Installation
pip install soxr
If installation fails, upgrade pip with python -m pip install --upgrade pip and try again.
in Conda environment
conda install -c conda-forge soxr-python
Note: Conda packge name is soxr-python, not python-soxr.
Basic usage
import soxr
y = soxr.resample(
x, # input array – mono(1D) or multi-channel(2D of [frame, channel])
48000, # input samplerate
16000 # target samplerate
)
If input is not numpy.ndarray, it will be converted to numpy.ndarray(dtype='float32').
dtype should be one of float32, float64, int16, int32.