Note: This is a fork tailored for Pozalabs internal use. The API may differ significantly from upstream.
Pydub lets you do stuff to audio in a way that isn't stupid.
This is a Pozalabs fork of jiaaro/pydub, published as pozalabs-pydub on PyPI.
- Python 3.11+ (upstream supports Python 2.7+)
- All legacy Python 2 compatibility code has been removed
overlay_segments- Pre-allocated buffer overlay replacing audioop.add/mul (16-bit 4-5x, 32-bit 11-16x faster)extend_24bit_to_32bit- Zero-copy 24-bit to 32-bit sample extension via direct PyBytes allocation (~400x faster than pure Python)fade_segment- Single-pass fade replacing per-sample audioop.mul loop (used by fade/fade_in/fade_out). Upstream applies gain per millisecond (>100ms) or per sample (<=100ms); this implementation always applies gain per sample for consistent precisionmix_segments- N-segment single-pass mix in Rust (~2.9x faster than sequential overlay chaining with 19 segments)
- Compressed audio I/O -
from_file()auto-detects and decompresses gzip/zstd files;export()accepts an optionalcompressorparameter - Audio level metering -
measure_audio_level()for RMS, peak, and LUFS measurement - Waveform data -
get_normalized_amplitudes()computes normalized amplitude values for waveform visualization - Silent audio generation - Create silent audio matching the original segment's parameters
- Multi-segment mix -
AudioSegment.mix(*segs)classmethod for mixing N segments simultaneously - Audio processing framework - Command-based processor architecture for merge, overlay, and format conversion
- Python 3.13 support - Via
audioop-ltsdependency
from_file_using_temporary_files- Redundant legacy method replaced byfrom_file(pipe I/O, codec inference, compression support)AudioSegment.ffmpeg- Legacy class property alias forAudioSegment.convertereffects/scipy_effectsmodules - All dynamically registered effects (normalize,speedup,compress_dynamic_range,invert_phase,low_pass_filter,high_pass_filter,pan,apply_gain_stereo,strip_silence,eq, etc.) and theregister_pydub_effectdecorator
- Comprehensive type hints using
Self,Literal,TypedDict,Unpack _AudioParamsdataclass with validation for initialization parameters
pyproject.tomlwith maturin backend, managed by uv- Rust(PyO3) native extension compiled via maturin
- Wheel distribution via GitHub Actions
backports.zstd(>=1.3.0) - Zstandard compression (Python <3.14, stdlibcompression.zstdon 3.14+)
For general usage, API documentation, and ffmpeg setup, see the upstream README.
MIT License - Copyright 2011 James Robert