A Python package for Spark-TTS.
Project description
📦 Install
pip install spark-tts-lib
🌟 Sample Example
from spark_tts_lib import SparkTTS
model = SparkTTS()
wav_data = model.inference(text="Hello, world!")
🚀 Usage
Download the pretrained model:
from spark_tts_lib 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")You can also download the model from the Hugging Face page.
Import SparkTTS:
from spark_tts_lib import SparkTTS
Initialize the model:
model = SparkTTS()
If you want to specify the model directory, you can do it like this:
model_dir = "pretrained_models/Spark-TTS-0.5B" model = SparkTTS(model_dir)
Perform voice creation inference:
text = "This is the text you want to synthesize into speech."
gender = "female" # "male"
pitch = "high" # "very_low" | "low" | "moderate" | "high" | "very_high"
speed = "high" # "very_low" | "low" | "moderate" | "high" | "very_high"
wav_data = model.inference(text=text, gender=gender, pitch=pitch, speed=speed)
Perform voice cloning 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."
wav_data = model.inference(
text=text,
prompt_speech_path=prompt_speech_path,
prompt_text=prompt_text,
)
Inference with more parameters:
model.inference(
...
temperature=0.8,
top_k=50,
top_p=0.95,
)
📚 More information
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.2.0.tar.gz.
File metadata
- Download URL: spark_tts_lib-0.2.0.tar.gz
- Upload date:
- Size: 323.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
594b59570d1db27a71ea7937a1cd39335eb0518717bfa2f19c1c053655710756
|
|
| MD5 |
5a40045d178c23a7ca3cca4d0da2fd37
|
|
| BLAKE2b-256 |
9a75baffad71fbea37db19307a3b7f6dbf5cf66508f1214745c0881c8add4459
|
Provenance
The following attestation bundles were made for spark_tts_lib-0.2.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.2.0.tar.gz -
Subject digest:
594b59570d1db27a71ea7937a1cd39335eb0518717bfa2f19c1c053655710756 - Sigstore transparency entry: 190101597
- Sigstore integration time:
-
Permalink:
YowFung/Spark-TTS-Lib@c09fefdc925135f893a928f4d625620032b076bf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/YowFung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c09fefdc925135f893a928f4d625620032b076bf -
Trigger Event:
release
-
Statement type:
File details
Details for the file spark_tts_lib-0.2.0-py3-none-any.whl.
File metadata
- Download URL: spark_tts_lib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 56.4 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 |
a5b8a5c0fddf69b98ab7d1d497ec63ddc49fcd0a97dd205a823f1def0b723d5a
|
|
| MD5 |
42496ef3f10a6e22beed3c0a567fd5d7
|
|
| BLAKE2b-256 |
8f6bcb9a2407858876d8d890ed4dc2889249a6c1fbbd7257569043341fe70f21
|
Provenance
The following attestation bundles were made for spark_tts_lib-0.2.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.2.0-py3-none-any.whl -
Subject digest:
a5b8a5c0fddf69b98ab7d1d497ec63ddc49fcd0a97dd205a823f1def0b723d5a - Sigstore transparency entry: 190101599
- Sigstore integration time:
-
Permalink:
YowFung/Spark-TTS-Lib@c09fefdc925135f893a928f4d625620032b076bf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/YowFung
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@c09fefdc925135f893a928f4d625620032b076bf -
Trigger Event:
release
-
Statement type: