skillfed

sox

Python wrapper around SoX.

sox v1.5.0 908.8K downloads/30d#4,751 on PyPI541
Permissive license BSD-3-Clause AGING released

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 sox

uv

uv add sox

poetry

poetry add sox

Installing 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

audio effects processing pythonsox wrapper pythonaudio trimming compression fadeaudio format conversionaudio signal processing librarybatch audio transformationpitch shifting audio python
audio-processingsox-wrappersignal-processing

More Graphics packages