{"library":"pyworld","title":"PyWorld: Python Wrapper for WORLD Vocoder","description":"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]","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install pyworld"],"cli":null},"imports":["import pyworld as pw"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import numpy as np\nimport pyworld as pw\n\n# Simulate a mono audio waveform (e.g., 2 seconds at 44.1 kHz)\nfs = 44100 # Sampling frequency\nt = np.arange(0, 2.0, 1.0/fs) # Time vector\nf0_val = 200 # Hz\nx = 0.5 * np.sin(2 * np.pi * f0_val * t).astype(np.float64)\n\n# Ensure the waveform is float64 as expected by pyworld\n# Extract WORLD features\nf0, sp, ap = pw.wav2world(x, fs)\n\nprint(f\"Extracted f0 shape: {f0.shape}\")\nprint(f\"Extracted spectral envelope shape: {sp.shape}\")\nprint(f\"Extracted aperiodicity shape: {ap.shape}\")\n\n# Synthesize speech back (optional, requires additional components like 'y')\ny_synthesized = pw.synthesize(f0, sp, ap, fs)\nprint(f\"Synthesized audio shape: {y_synthesized.shape}\")","lang":"python","description":"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]","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}