#PyWorldVocoder
A Python wrapper for World Vocoder
Morise's World Vocoder is a fast and high-quality vocoder. World Vocoder parameterizes speech into three components:
- Pitch (fundamental frequency, F0) contour
- smoothed spectrogram
- aperiodicity
It can also resynthesize speech using these features.
For more information, please visit Morise's Github repository:
https://github.com/mmorise/World
And the official website of World Vocoder:
http://ml.cs.yamanashi.ac.jp/world/english/
##APIs
###Vocoder Functions
import pyworld as pw
pyDioOpt = pw.pyDioOption()
_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, pyDioOpt.option['frame_period'])
###Utility
# Convert speech into features (using default options)
f0, sp, ap, pyDioOpt = pw.wav2world(x, fs)
Linux Ubuntu 14.04
Python 2.7.6 on
Cython 0.24 is required
Prerequisite:
- Please
git clone
Morise's World (C++ version) first (https://github.com/mmorise/World) - Then
git clone
this repository, and move all the files to the directory of World.
If you just want to try out some experiments:
- Execute
python setup.py build_ext --inplace
Then you can use PyWorld from this directory. - You can also copy the resulting pyworld.so file to
~/.local/lib/python2.7/site-packages
so that you can use it everywhere like an installed package.
If you want to "install" this package, try
python setup.py install
Hint:
- add
--user
if you don't have root access - If you want to uninstall PyWorld, just remove the pyworld files from the installation directory.
- You can validate installation by running
python demo.py
to see if you get results in the test/
direcotry.
- 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, andpython setup.py install
it.
(I triedpip install Cython
but the upgrade didn't seem correct)
(Again, add--user
if you don't have root access.)
- This wrapper is an updated version of sotelo's "world.py"
https://github.com/sotelo/world.py
- Realtime synthesizer