Skip to main content

CosyVoice-ttsfrd

This package is a wrapper for the ttsfrd library used in CosyVoice. It simplifies installation by bundling the required wheels and resources.

!! Important

  • Platform: This package will only work on 64-bit Linux with Python 3.10.
  • License: This package redistributes software under the [Apache 2.0 License], which is the original license used in CosyVoice.
  • Purpose: This is a convenience wrapper. All credit goes to the original authors of CosyVoice and the ttsfrd library.

Installation

# Step 1: Install this wrapper package
pip install cosyvoice-ttsfrd
# Step 2: After the wrapper is installed, you must run the following command in your terminal. This will install the actual `ttsfrd` libraries and unzip the required resources.
cosyvoice-post-install

The installation process will automatically install the bundled ttsfrd wheels and unzip the required resources into the package directory. Installation log looks like:

▶ cosyvoice-post-install
CosyVoice-ttsfrd initialized. Resources are expected in: /mnt/user-ssd/songxingchen/.conda/envs/touchnet/lib/python3.10/site-packages/cosyvoice_ttsfrd/resource
--- Running Post-Installation Setup for CosyVoice-TTSFRD ---
Unzipping resources to /mnt/user-ssd/songxingchen/.conda/envs/touchnet/lib/python3.10/site-packages/cosyvoice_ttsfrd...
Resources unzipped. Package contents:
- __init__.py
- __pycache__
- bundled_files
- post_install.py
- resource
Installing ttsfrd_dependency-0.1-py3-none-any.whl from bundled file...
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Processing /mnt/user-ssd/songxingchen/.conda/envs/touchnet/lib/python3.10/site-packages/cosyvoice_ttsfrd/bundled_files/ttsfrd_dependency-0.1-py3-none-any.whl
Installing collected packages: ttsfrd-dependency
Successfully installed ttsfrd-dependency-0.1
Installing ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl from bundled file...
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Processing /mnt/user-ssd/songxingchen/.conda/envs/touchnet/lib/python3.10/site-packages/cosyvoice_ttsfrd/bundled_files/ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl
Installing collected packages: ttsfrd
Successfully installed ttsfrd-0.4.2
--- ✅ Post-Installation Finished Successfully! ---
You can now use the 'ttsfrd' module in your Python scripts.

Usage

After installation, you can import and use ttsfrd as you normally would. If you need to access the unzipped resources programmatically, you can do so like this:

import json
import ttsfrd
from cosyvoice_ttsfrd import get_resource_path

resource_dir = get_resource_path()
print(f"Resources are located at: {resource_dir}")

frd = ttsfrd.TtsFrontendEngine()
frd.initialize(resource_dir)
frd.set_lang_type('pinyinvg')

text = "嘿,你是不是在纠结,家里到底是该买个55~60的投影仪呢,还是整个大屏幕电视啊?这俩玩意儿确实各有各的好,选哪个主要就看你的钱袋子、平时都用它干啥、对画质要求高不高,还有家里地方够不够大。"
texts = [i["text"] for i in json.loads(frd.do_voicegen_frd(text))["sentences"]]
text = ''.join(texts)
print(text)

Metadata

Release files for cosyvoice-ttsfrd 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cosyvoice-ttsfrd 0.4.3
File Size Uploaded
cosyvoice_ttsfrd-0.4.3.tar.gz 5.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for cosyvoice-ttsfrd 0.4.3
File Interpreter ABI Platform
cosyvoice_ttsfrd-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 MB

Release files / cosyvoice_ttsfrd-0.4.3.tar.gz

Download URL cosyvoice_ttsfrd-0.4.3.tar.gz
Size 5.1 MB
Tags Source
SHA-256 checksum
How to use checksums
fc7b4a25067b3928439ed27f613ab8a6f221f39423797e58aadec96b59c8d6ea
BLAKE2b-256 checksum
How to use checksums
908e5b4fb09b3f0def550eeb203ecb9531e71ff6a459f7fba56619451921c90a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release files / cosyvoice_ttsfrd-0.4.3-py3-none-any.whl

Download URL cosyvoice_ttsfrd-0.4.3-py3-none-any.whl
Size 5.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
52122c0b823b392f7b25f54a2b574c86737bee098b2c3ac811b275d2d90ba087
BLAKE2b-256 checksum
How to use checksums
13805336a933eb107b6c95f4e5b05ed4112309dda1205965fe53be635f69aeeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.17

Release history Release notifications | RSS feed

This release

0.4.3 This release

2 release files

0.4.2

2 release 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