--- id: stftpitchshift version: "2.0" license: MIT license_treatment: permissive maintenance: aging --- # stftpitchshift — STFT based pitch and timbre shifting License: permissive · Maintenance: aging · Downloads: 80.8K/mo ## What it is and what it does stftpitchshift is a Python library that shifts the pitch and timbre of audio signals using STFT-based spectral analysis. It implements the instantaneous frequency estimation technique (vocoder) to decompose audio into magnitude and frequency components, then resamples those components according to a pitch shift factor. The library also includes formant preservation via cepstral analysis to reduce the Mickey Mouse effect that occurs when pitch-shifting vocal audio. The package comes as both a library for embedding in Python projects and a command-line tool for batch processing .wav files. It depends on click for CLI support, numpy for numerical operations, and matplotlib for visualization. The core algorithm is inspired by Stephan M. Bernsee's smbPitchShift and supports mono pitch shifting, polyphonic pitch shifting (multiple simultaneous pitch shifts in a single frame), and optional RMS normalization. Use it for: - Shift vocal recordings to different keys without changing playback speed. - Correct pitch issues in recorded audio or apply creative pitch effects. - Preserve vocal formants while shifting pitch to avoid unnatural-sounding results. - Combine multiple pitch shifts simultaneously in a single STFT frame for harmonic synthesis. - Batch-process .wav files from the command line with configurable window sizes and overlap. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Shifts the pitch and timbre of audio signals using Short-Time Fourier Transform (STFT) analysis, with optional formant preservation to avoid the Mickey Mouse effect. Yes, if you need STFT-based pitch shifting with formant preservation. The library is stable, permissively licensed, has low install friction, and no known vulnerabilities. The aging maintenance status (last release December 2023) is a minor concern for long-term support but not a blocker for current use. Install if you're building audio processing tools or need precise spectral pitch control. ## Install pip install stftpitchshift uv add stftpitchshift poetry add stftpitchshift ## Installing stftpitchshift Before you install: Low friction install via pip with only three runtime dependencies (click, matplotlib, numpy). Repository is aging but not abandoned—last commit September 2025, 194 stars, no recent releases since December 2023. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions. Quickstart: pip install stftpitchshift from stftpitchshift import StftPitchShift pitchshifter = StftPitchShift(1024, 256, 44100) x = [0] * 44100 y = pitchshifter.shiftpitch(x, 1) Requires audio data as a list or array-like object; no built-in file I/O in the library itself, though the command-line tool handles .wav files. Verify before relying: - Real-time performance characteristics and latency for interactive applications. - Accuracy of formant preservation across different voice types and frequencies. - Poly pitch shifting quality when combining many simultaneous pitch shifts. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 80.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pitch shifting audio, stft pitch shift, audio timbre shifting, formant preservation, real-time pitch shifting, spectral audio processing, polyphonic pitch shift, audio-processing, dsp, spectral-analysis [View on SkillFed](https://skillfed.io/packages/stftpitchshift) · [View on PyPI](https://pypi.org/project/stftpitchshift/)