Skip to main content

pylstraight

This is an unofficial Python reimplementation of the legacy-STRAIGHT, which was originally written in MATLAB.

Manual Downloads ClickPy Python Version PyPI Anaconda Codecov License GitHub Actions Ruff

Requirements

  • Python 3.8+

Documentation

Installation

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

Supported Features

  • Fundamental frequency extraction
  • Aperiodicity measure extraction
  • Spectral envelope extraction
  • Synthesis using the extracted parameters

Unsupported Features

  • Batch processing
  • GPU acceleration
  • JIT compilation

Example

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)

License

The original code is licensed under the Apache License 2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylstraight-0.1.2.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylstraight-0.1.2-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

Details for the file pylstraight-0.1.2.tar.gz.

File metadata

  • Download URL: pylstraight-0.1.2.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.12

File hashes

Hashes for pylstraight-0.1.2.tar.gz
Algorithm Hash digest
SHA256 24b5c7fb2c3d14979133e2fb31c75007d3f8b7a9b237dec9ff2591085d7605a2
MD5 aff2b0e17c61d80c7dc0d78b11f5867d
BLAKE2b-256 70a4c6eb33b105ff2e035c64cc751c4ed85a89a07641700204c1e6daf57a0ced

See more details on using hashes here.

File details

Details for the file pylstraight-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pylstraight-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 42.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.12

File hashes

Hashes for pylstraight-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0ef049843e263cae300c5c38704273286aa1323e6a410d38936619399b781058
MD5 8ee5227fc1065ec4979e975d94deda63
BLAKE2b-256 d26752142e80e6b80396ae3df1d2e98351557f3e31c55481d99d748397b46f25

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page