This is an unofficial Python reimplementation of the legacy-STRAIGHT, which was originally written in MATLAB.
- Python 3.8+
- See this page for the reference manual.
The latest stable release can be installed from PyPI by running the command below.
pip install pylstraight
The development release can be installed from the master branch using the following command:
pip install git+https://github.com/takenori-y/pylstraight.git@master
- Fundamental frequency extraction
- Aperiodicity measure extraction
- Spectral envelope extraction
- Synthesis using the extracted parameters
- Batch processing
- GPU acceleration
- JIT compilation
import pylstraight as pyls
# Read an example waveform.
x, fs = pyls.read("assets/data.wav")
# Set control parameters.
fp = 5 # Frame shift in msec
f0_range = (60, 240) # F0 search range in Hz
# Extract the STRAIGHT parameters.
f0 = pyls.extract_f0(x, fs, f0_range=f0_range, frame_shift=fp)
ap = pyls.extract_ap(x, fs, f0, frame_shift=fp)
sp = pyls.extract_sp(x, fs, f0, frame_shift=fp)
# Synthesize a waveform using the parameters.
sy = pyls.synthesize(f0, ap, sp, fs, frame_shift=fp)
# Write the synthesized waveform.
pyls.write("data.syn.wav", sy, fs)
The original code is licensed under the Apache License 2.0.