# pylstraight
This is an unofficial Python reimplementation of the [legacy-STRAIGHT](https://github.com/HidekiKawahara/legacy_STRAIGHT), which was originally written in MATLAB.
[](https://takenori-y.github.io/pylstraight/0.1.0/)
[](https://pepy.tech/project/pylstriaght)
[](https://pypi.python.org/pypi/pylstraight)
[](https://pypi.python.org/pypi/pylstraight)
[](https://app.codecov.io/gh/takenori-y/pylstraight)
[](https://github.com/takenori-y/pylstraight/blob/master/LICENSE)
[](https://github.com/takenori-y/pylstraight/actions)
[](https://github.com/astral-sh/ruff)
## Requirements
- Python 3.8+
## Documentation
- See [this page](https://takenori-y.github.io/pylstraight/0.1.0/) for the reference manual.
## Installation
The latest stable release can be installed from PyPI by running the command below.
```sh
pip install pylstraight
```
The development release can be installed from the master branch using the following command:
```sh
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
```py
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "pylstraight",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Takenori Yoshimura <takenori@sp.nitech.ac.jp>",
"keywords": "signal processing, speech analysis, straight, vocoder",
"author": "Takenori Yoshimura",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/62/72/5a9f160ddc23450bd990d18370a6b6886ff941f2af3c3c00759cb6bc9f25/pylstraight-0.1.0.tar.gz",
"platform": null,
"description": "# pylstraight\n\nThis is an unofficial Python reimplementation of the [legacy-STRAIGHT](https://github.com/HidekiKawahara/legacy_STRAIGHT), which was originally written in MATLAB.\n\n[](https://takenori-y.github.io/pylstraight/0.1.0/)\n[](https://pepy.tech/project/pylstriaght)\n[](https://pypi.python.org/pypi/pylstraight)\n[](https://pypi.python.org/pypi/pylstraight)\n[](https://app.codecov.io/gh/takenori-y/pylstraight)\n[](https://github.com/takenori-y/pylstraight/blob/master/LICENSE)\n[](https://github.com/takenori-y/pylstraight/actions)\n[](https://github.com/astral-sh/ruff)\n\n## Requirements\n\n- Python 3.8+\n\n## Documentation\n\n- See [this page](https://takenori-y.github.io/pylstraight/0.1.0/) for the reference manual.\n\n## Installation\n\nThe latest stable release can be installed from PyPI by running the command below.\n\n```sh\npip install pylstraight\n```\n\nThe development release can be installed from the master branch using the following command:\n\n```sh\npip install git+https://github.com/takenori-y/pylstraight.git@master\n```\n\n## Supported Features\n\n- Fundamental frequency extraction\n- Aperiodicity measure extraction\n- Spectral envelope extraction\n- Synthesis using the extracted parameters\n\n## Unsupported Features\n\n- Batch processing\n- GPU acceleration\n- JIT compilation\n\n## Example\n\n```py\nimport pylstraight as pyls\n\n# Read an example waveform.\nx, fs = pyls.read(\"assets/data.wav\")\n\n# Set control parameters.\nfp = 5 # Frame shift in msec\nf0_range = (60, 240) # F0 search range in Hz\n\n# Extract the STRAIGHT parameters.\nf0 = pyls.extract_f0(x, fs, f0_range=f0_range, frame_shift=fp)\nap = pyls.extract_ap(x, fs, f0, frame_shift=fp)\nsp = pyls.extract_sp(x, fs, f0, frame_shift=fp)\n\n# Synthesize a waveform using the parameters.\nsy = pyls.synthesize(f0, ap, sp, fs, frame_shift=fp)\n\n# Write the synthesized waveform.\npyls.write(\"data.syn.wav\", sy, fs)\n```\n\n## License\n\nThe original code is licensed under the Apache License 2.0.\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "A Python reimplementation of the legacy STARIGHT",
"version": "0.1.0",
"project_urls": {
"Documentation": "https://takenori-y.github.io/pylstraight/latest/",
"Source": "https://github.com/takenori-y/pylstraight"
},
"split_keywords": [
"signal processing",
" speech analysis",
" straight",
" vocoder"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "daa23d338b4bd5a5fdb518a95f0fdeb3d2f92335d46b394c9e762c2ae3c82248",
"md5": "c91190438a9848e707b22c8ed83ba330",
"sha256": "f1cf693892d2c360d2024b46896739117289166781f3443b47e85009332e5589"
},
"downloads": -1,
"filename": "pylstraight-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c91190438a9848e707b22c8ed83ba330",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 41051,
"upload_time": "2025-01-28T01:57:30",
"upload_time_iso_8601": "2025-01-28T01:57:30.986705Z",
"url": "https://files.pythonhosted.org/packages/da/a2/3d338b4bd5a5fdb518a95f0fdeb3d2f92335d46b394c9e762c2ae3c82248/pylstraight-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "62725a9f160ddc23450bd990d18370a6b6886ff941f2af3c3c00759cb6bc9f25",
"md5": "82013d2835ec9ffd2b2aeb047cd6e7a9",
"sha256": "508042e32f6dd856beb32714fc2e9db5ab5020284db91028e69c82ee0f7e501f"
},
"downloads": -1,
"filename": "pylstraight-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "82013d2835ec9ffd2b2aeb047cd6e7a9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 34443,
"upload_time": "2025-01-28T01:58:18",
"upload_time_iso_8601": "2025-01-28T01:58:18.389259Z",
"url": "https://files.pythonhosted.org/packages/62/72/5a9f160ddc23450bd990d18370a6b6886ff941f2af3c3c00759cb6bc9f25/pylstraight-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-28 01:58:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "takenori-y",
"github_project": "pylstraight",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pylstraight"
}