WORLD Vocoder is a fast and high-quality vocoder which parameterizes speech into three components:
f0: Pitch contour
sp: Harmonic spectral envelope
ap: Aperiodic spectral envelope (relative to the harmonic spectral envelope)
It can also (re)synthesize speech using these features (see examples below).
import pyworld as pw _f0, t = pw.dio(x, fs) # raw pitch extractor f0 = pw.stonemask(x, _f0, t, fs) # pitch refinement sp = pw.cheaptrick(x, f0, t, fs) # extract smoothed spectrogram ap = pw.d4c(x, f0, t, fs) # extract aperiodicity y = pw.synthesize(f0, sp, ap, fs) # synthesize an utterance using the parameters
# Convert speech into features (using default arguments) f0, sp, ap = pw.wav2world(x, fs)
You can change the default arguments of the function, too.
See more info using
pip install pyworld
git clone https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder.git cd Python-Wrapper-for-World-Vocoder git submodule update --init pip install -U pip pip install -r requirements.txt pip install .
It will automatically
git clone Morise's World Vocoder (C++ version).
(It seems to me that using
conda is the best practice.)
You can validate installation by running
cd demo python demo.py
to see if you get results in
(Please avoid writing and executing codes in the
Python-Wrapper-for-World-Vocoder folder for now.)
You can install dependencies these by
pip install -r requirements.txt
diois a better option.
Upgrade your Cython version to 0.24.
(I failed to build it on Cython 0.20.1post0)
It'll require you to download Cython form http://cython.org/
Unzip it, and
python setup.py install it.
pip install Cython but the upgrade didn't seem correct)
--user if you don't have root access.)
demo/demo.py, the following code might be needed in some environments (e.g. when you're working on a remote Linux server):
import matplotlib matplotlib.use('Agg')
If you encounter
library not found: sndfile error upon executing
you might have to install it by
apt-get install libsoundfile1.
You can also replace
librosa, but some modification is needed:
dtypeargument to ensure that the method gives you a
If you have installation issue on Windows, I probably could not provide much help because my development environment is Ubuntu and Windows Subsystem for Linux (read this if you are interested in installing it).
pip install .is safer and you can easily uninstall pyworld by
pip uninstall pyworld
MACOSX_DEPLOYMENT_TARGET=10.9 pip install .See issue.
python setup.py install
--userif you don't have root access
--record install.txtto track the installation dir
python setup.py build_ext --inplace
~/.local/lib/python2.7/site-packages(or corresponding Windows directory) so that you can use it everywhere like an installed package.
pip install -e .