A Python library for voice cloning using Spark-TTS.
Project description
Install
pip install spark-tts-lib
Usage
Model download:
from spark_tts_lib.download import download_pretrained_model
download_pretrained_model()
The model will be downloaded to the
pretrained_models/Spark-TTS-0.5Bdirectory in the current directory. You can also specify a directory to save it.download_pretrained_model(local_dir="/path/to/save/model")
Inference:
from spark_tts_lib.SparkTTS import SparkTTS
# Initialize the model
model_dir = "pretrained_models/Spark-TTS-0.5B"
model = SparkTTS(model_dir)
# Perform inference and get the generated audio data
wav_data = model.inference(
text="This is the text you want to synthesize into speech.",
prompt_speech_path="prompt_audio.wav",
prompt_text="This is the text corresponding to your reference audio.",
)
# Save or use the generated audio data
# ...
Set the temperature, top_k, top_p to control the generated audio:
model.inference(
text="...",
prompt_speech_path="...",
prompt_text="...",
temperature=0.8,
top_k=50,
top_p=0.95,
)
You can use more parameters and more components, please refer to the Spark-TTS for more details.
⚠️ Usage Disclaimer
This project provides a zero-shot voice cloning TTS model intended for academic research, educational purposes, and legitimate applications, such as personalized speech synthesis, assistive technologies, and linguistic research.
Please note:
-
Do not use this model for unauthorized voice cloning, impersonation, fraud, scams, deepfakes, or any illegal activities.
-
Ensure compliance with local laws and regulations when using this model and uphold ethical standards.
-
The developers assume no liability for any misuse of this model.
We advocate for the responsible development and use of AI and encourage the community to uphold safety and ethical principles in AI research and applications. If you have any concerns regarding ethics or misuse, please contact us.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spark_tts_lib-0.1.0.tar.gz.
File metadata
- Download URL: spark_tts_lib-0.1.0.tar.gz
- Upload date:
- Size: 322.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1edaf50f325eeec77ae48b9eb7841a48428f9f69a871c77f40032cf57cfd334a
|
|
| MD5 |
13b2a7901c01548a8101aa9afb83d5f5
|
|
| BLAKE2b-256 |
e187376594262b722df640922dd457af98a2049acfd212a5dec697ba94203a6b
|
Provenance
The following attestation bundles were made for spark_tts_lib-0.1.0.tar.gz:
Publisher:
python-publish.yml on YowFung/Spark-TTS-Lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spark_tts_lib-0.1.0.tar.gz -
Subject digest:
1edaf50f325eeec77ae48b9eb7841a48428f9f69a871c77f40032cf57cfd334a - Sigstore transparency entry: 189747282
- Sigstore integration time:
-
Permalink:
YowFung/Spark-TTS-Lib@67eb4027b3667aeb936e6dbbce66dfc4baaea65b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/YowFung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@67eb4027b3667aeb936e6dbbce66dfc4baaea65b -
Trigger Event:
release
-
Statement type:
File details
Details for the file spark_tts_lib-0.1.0-py3-none-any.whl.
File metadata
- Download URL: spark_tts_lib-0.1.0-py3-none-any.whl
- Upload date:
- Size: 56.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb9dfc33013e83ed074af61989f4131be10e792863d8087ba5dbf615a3f82faf
|
|
| MD5 |
8aebfcc87409fbe510dada64d92f2c43
|
|
| BLAKE2b-256 |
b2e4a08aac3b7084a6cb5642c74d929f90607cf927acf60b43d71017d983b5e8
|
Provenance
The following attestation bundles were made for spark_tts_lib-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on YowFung/Spark-TTS-Lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spark_tts_lib-0.1.0-py3-none-any.whl -
Subject digest:
fb9dfc33013e83ed074af61989f4131be10e792863d8087ba5dbf615a3f82faf - Sigstore transparency entry: 189747283
- Sigstore integration time:
-
Permalink:
YowFung/Spark-TTS-Lib@67eb4027b3667aeb936e6dbbce66dfc4baaea65b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/YowFung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@67eb4027b3667aeb936e6dbbce66dfc4baaea65b -
Trigger Event:
release
-
Statement type: