sox
Python wrapper around SoX.
What it is and what it does
pysox is a Python wrapper around the SoX command-line audio processor, exposing its effects and transformations through a Transformer class for file-to-file and array-to-array audio processing, and a Combiner class for concatenating multiple audio files. It depends on numpy for array handling and requires SoX itself to be installed as a system dependency.
The package lets you apply audio effects (compression, fading, pitch shifting, trimming), convert formats and sample rates, and work with audio either as files or in-memory numpy arrays. It is typically used in audio analysis pipelines, music information retrieval workflows, and batch audio preprocessing tasks where SoX's command-line tools are needed from Python without spawning subprocesses directly.
Use it for:
- Trim, compress, and fade audio files in batch preprocessing pipelines for machine learning datasets.
- Pitch-shift or resample in-memory audio arrays during real-time audio analysis or feature extraction.
- Concatenate multiple audio files with effects applied in a single operation.
- Convert audio between formats (WAV, AIFF, MP3, FLAC, OGG) and sample rates programmatically.
- Query audio file metadata (sample rate, duration, silence detection) without external subprocess calls.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python wrapper that exposes SoX audio processing capabilities—trimming, effects, format conversion, and concatenation—via a Transformer and Combiner API.
Yes, with conditions. Install if you need SoX's audio processing power from Python and can meet the system dependency requirement (SoX 14.4.2+). The package is stable and permissively licensed, but maintenance is aging (last release 2024-03-20) and Python version support is unspecified—verify compatibility before relying on it in production. High install friction and lack of recent activity make it less suitable for new projects unless SoX integration is essential.
Install
sox on PyPI
pip
pip install soxuv
uv add soxpoetry
poetry add soxInstalling sox
Before you install
High install friction: requires SoX 14.4.2+ to be installed separately on the system (via Homebrew, apt-get, or source). Package maintenance is aging—last release was 2024-03-20, over 877 days ago, though the repository remains active and unarchivedwith recent commits.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and disclaimer in distributions.
Quickstart
import sox
tfm = sox.Transformer()
tfm.trim(5, 10.5)
tfm.compand()
tfm.build_file('input.wav', 'output.aiff')
# or with in-memory arrays
import numpy as np
y = np.sin(2 * np.pi * 440.0 * np.arange(44100) / 44100)
tfm = sox.Transformer()
tfm.pitch(2)
y_out = tfm.build_array(input_array=y, sample_rate_in=44100)
SoX version 14.4.2 or higher must be installed on the system before importing sox; Python support version is unspecified.
Verify before relying
- Exact Python version compatibility (requires_python is unspecified in metadata)
- Whether high install friction reflects unresolved dependency issues or simply the need for a system library
- Current test coverage and whether aging maintenance affects reliability for modern audio formats
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | 2 — numpy, typing-extensions |
| Maintenance | aging — 877 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 908,777/month — #4,751 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sox-1.5.0.tar.gz
Keywords: audio, effects, SoX
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
soxrPerforms high-quality sample-rate conversion…
copyleft · top 5,000 on PyPI
audiofileReads and writes audio files across formats…
permissive · top 15,000 on PyPI
audiomentationsAudiomentations applies randomized audio…
permissive · top 15,000 on PyPI
python-stretchPitch-shifts and time-stretches audio using the…
permissive · top 15,000 on PyPI
stftpitchshiftShifts the pitch and timbre of audio signals…
permissive · top 15,000 on PyPI
miniaudioMiniaudio provides Python bindings for…
permissive · top 15,000 on PyPI
pedalboardpedalboard reads, writes, and processes audio…
copyleft · top 5,000 on PyPI
fmod-toolkitExtracts and exports audio from FMOD sound bank…
permissive · top 15,000 on PyPI
python_speech_featuresExtracts speech features from audio signals for…
permissive · top 15,000 on PyPI