rikrd / Python-Wrapper-for-World-Vocoder

A Python wrapper for the high-quality vocoder "World"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#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:

  1. Pitch (fundamental frequency, F0) contour
  2. smoothed spectrogram
  3. 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)

Installation

Linux Ubuntu 14.04
Python 2.7.6 on
Cython 0.24 is required

Prerequisite:

  1. Please git clone Morise's World (C++ version) first (https://github.com/mmorise/World)
  2. Then git clone this repository, and move all the files to the directory of World.

If you just want to try out some experiments:

  1. Execute
    python setup.py build_ext --inplace
    Then you can use PyWorld from this directory.
  2. 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:

  1. add --user if you don't have root access
  2. If you want to uninstall PyWorld, just remove the pyworld files from the installation directory.
  3. You can validate installation by running

python demo.py
to see if you get results in the test/ direcotry.

Troubleshooting

  1. 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.
    (I tried pip install Cython but the upgrade didn't seem correct)
    (Again, add --user if you don't have root access.)

Note:

  1. This wrapper is an updated version of sotelo's "world.py"
    https://github.com/sotelo/world.py

TODO List

  • Realtime synthesizer

About

A Python wrapper for the high-quality vocoder "World"


Languages

Language:Python 100.0%