--- id: python-stretch version: "0.3.1" license: unclear license_treatment: permissive maintenance: active --- # python-stretch — Simple python library for pitch shifting and time stretching License: permissive · Maintenance: active · Downloads: 183.3K/mo ## What it is and what it does python-stretch is a Python wrapper around the Signalsmith Stretch C++ library that provides time stretching and pitch shifting for audio. It accepts audio as 2D arrays (channels × samples) and outputs processed audio in the same format, supporting both mono and multichannel audio with independent control of pitch (via semitone shifts) and playback speed (via time factor). The package is actively maintained, has prebuilt wheels for Python 3.10–3.12 across macOS, Linux, and Windows, and carries no known security vulnerabilities. It is a thin binding to a mature C++ algorithm library, so installation is straightforward on supported platforms, though building from source requires a C++ compiler and CMake. Use it for: - Transpose audio by semitones while preserving original tempo for music analysis or remixing. - Slow down or speed up audio playback without changing pitch for speech processing or practice. - Batch process multichannel recordings with consistent pitch and tempo adjustments. - Integrate pitch and time stretching into audio processing pipelines. - Create pitch-shifted or time-stretched augmentations of audio data for training. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Pitch-shifts and time-stretches audio using the Signalsmith Stretch C++ library, working with mono and multichannel audio data. Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and offers a straightforward interface to a proven C++ algorithm. Install friction is moderate but manageable via prebuilt wheels on common platforms. It is a good choice if you need reliable pitch shifting and time stretching. ## Install pip install python-stretch uv add python-stretch poetry add python-stretch ## Installing python-stretch Before you install: Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.10–3.12 on macOS, Linux, and Windows, but building from source requires a C++ compiler and CMake. License in practice: MIT license (permissive); you can use, modify, and distribute this package freely with minimal restrictions. Quickstart: import python_stretch as ps # Assume audio is a 2D array (channels × samples) stretch = ps.Signalsmith.Stretch() stretch.preset(audio.shape[0], sr) # numChannels, sampleRate stretch.setTransposeSemitones(12) # Shift up one octave stretch.timeFactor = 0.75 # Slow down to 75% speed audio_processed = stretch.process(audio) If building from source, requires a C++ compiler and CMake. Verify before relying: - Real-world latency or quality characteristics compared to other pitch-shifting libraries. - Whether the package supports streaming or only batch processing of audio. - Performance scaling with audio length or channel count. - Compatibility with audio libraries beyond those mentioned in the description. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 183.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pitch shifting audio python, time stretching library, audio pitch and tempo, signalsmith stretch wrapper, audio resampling pitch shift, tempo change audio, audio processing pitch shift, audio-processing, pitch-shifting, time-stretching [View on SkillFed](https://skillfed.io/packages/python-stretch) · [View on PyPI](https://pypi.org/project/python-stretch/)