PyWorld is a Python wrapper for the WORLD vocoder, a highly efficient and high-quality speech analysis, manipulation, and synthesis system. It allows users to extract fundamental frequency (f0), harmonic spectral envelope (sp), and aperiodic spectral envelope (ap) from speech, and subsequently synthesize speech from these parameters. The library is currently at version 0.3.5 and is actively maintained, though major releases have been infrequent. [1, 7, 9, 11]
pip install pyworldVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to simulate a basic audio waveform and then use `pyworld.wav2world` to extract the fundamental frequency (f0), spectral envelope (sp), and aperiodicity (ap). It also shows how to synthesize audio back from these features. [1, 7, 9]
Ensure input audio has a sampling frequency of 16 kHz or greater. Resample lower frequency audio before processing with PyWorld.
When loading audio, explicitly cast the array: `audio_data = librosa.load(filename, sr=fs, dtype=np.float64)[0]` or `audio_data = scipy.io.wavfile.read(filename)[1].astype(np.float64)`.
Consider using `f0, t = pw.harvest(x, fs)` instead of `pw.dio(x, fs)` for noisy audio segments.
Upgrade Cython to a sufficiently recent version, e.g., `pip install --upgrade Cython>=0.24`.