python-stretch
Simple python library for pitch shifting and time stretching
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- If building from source, requires a C++ compiler and CMake.
- 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 · maintenance · safety
permissive license (permissive) — MIT license (permissive); you can use, modify, and distribute this package freely with minimal restrictions.
last release 2025-02-14 (546 days) · last repo commit 2026-05-24 · 16 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 183,267 downloads/mo, #10,069 on PyPI
Alternatives
Verify before relying
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)- 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.
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 on this page. Verify before relying on it.
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
python-stretch on PyPI
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.
If 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)
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 | permissive license permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 546 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 183,267 / month, #10,069 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: C++Programming Language :: PythonTopic :: Multimedia :: Sound/Audio |
Evidence: python_stretch-0.3.1-cp310-cp310-macosx_10_14_x86_64.whl; python_stretch-0.3.1-cp310-cp310-macosx_11_0_arm64.whl; python_stretch-0.3.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; python_stretch-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_stretch-0.3.1-cp310-cp310-musllinux_1_2_i686.whl; python_stretch-0.3.1-cp310-cp310-musllinux_1_2_x86_64.whl; python_stretch-0.3.1-cp310-cp310-win32.whl; python_stretch-0.3.1-cp310-cp310-win_amd64.whl; python_stretch-0.3.1-cp311-cp311-macosx_10_14_x86_64.whl; python_stretch-0.3.1-cp311-cp311-macosx_11_0_arm64.whl; python_stretch-0.3.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; python_stretch-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; python_stretch-0.3.1-cp311-cp311-musllinux_1_2_i686.whl; python_stretch-0.3.1-cp311-cp311-musllinux_1_2_x86_64.whl; python_stretch-0.3.1-cp311-cp311-win32.whl; python_stretch-0.3.1-cp311-cp311-win_amd64.whl; python_stretch-0.3.1-cp312-abi3-macosx_10_14_x86_64.whl; python_stretch-0.3.1-cp312-abi3-macosx_11_0_arm64.whl; python_stretch-0.3.1-cp312-abi3-manylinux_2_17_i686.manylinux2014_i686.whl; python_stretch-0.3.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “time stretching library”
- python-stretchPitch-shifts and time-stretches audio using the Signalsmith Stretch…
- pyrubberbandProvides Python wrappers for time-stretching and pitch-shifting audio…
- audiomentationsAudiomentations applies randomized audio transformations—noise…
Give your agent the search over MCP, or paste the wish link into any chat.
More Sound/Audio packages
Reads and writes audio files in formats like WAV, FLAC, OGG, and MAT through libsndfile, exposing audio data as NumPy arrays.
Pydub provides a high-level Python interface for loading, manipulating, and exporting audio files with simple operations like slicing, concatenation, and format conversion.
However, the abandoned status since 2021-03-10 means no future fixes or compatibility updates—use it only if you can tolerate potential issues with newer Python…
Mutagen reads and writes audio metadata (tags) across many audio formats including MP3, FLAC, OGG, MP4, WavPack, and others, supporting ID3v2 and APEv2 tag editing.
Install it if you need to read or edit audio tags programmatically.
Provides PyTorch-based audio processing, transforms, and dataloaders for machine learning tasks, with GPU acceleration and autograd support for trainable audio features.
MoviePy is a Python library for video editing that reads, processes, and writes video and audio files by converting them to numpy arrays for frame-level manipulation and effect application.
Reads metadata (artist, title, duration, bitrate, and more) from audio files in formats including MP3, MP4, FLAC, OGG, WAV, and others, without writing or modifying tags.
Install it if you need to extract metadata from audio files without the overhead of a heavier library.
See also pyrubberband · stftpitchshift · basic-pitch · audiomentations · sox · pretty-midi · pysrt · soxr · aubio · symusic