Skip to main content

A Python package for Spark-TTS.

Project description

Spark-TTS-Lib

A Python package for Spark-TTS

version python mit

📦 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.5B directory 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


Download files

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

Source Distribution

spark_tts_lib-0.2.1.tar.gz (323.1 kB view details)

Uploaded Source

Built Distribution

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

spark_tts_lib-0.2.1-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

File details

Details for the file spark_tts_lib-0.2.1.tar.gz.

File metadata

  • Download URL: spark_tts_lib-0.2.1.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

Hashes for spark_tts_lib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1c0f342bddbd4059180e432089983a42746c8cc41a9f1be92346259b5af42f22
MD5 48887620eb0bbcde83d698a84972f4b6
BLAKE2b-256 41fa13c3d927e72395ab3ff54e918a34c295744a63c33df64264c6becc6ba9c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for spark_tts_lib-0.2.1.tar.gz:

Publisher: python-publish.yml on YowFung/Spark-TTS-Lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spark_tts_lib-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: spark_tts_lib-0.2.1-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

Hashes for spark_tts_lib-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f65af9d2b3c93a0e321bf612c10b1f048c6419dbe494f61b4fd716509131a04b
MD5 759b8ca17ac359490a70add00bb9c80c
BLAKE2b-256 1825446385c85a071e63c9e0090321e3e80e73af0e3d87f69c6832539cf6bfd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for spark_tts_lib-0.2.1-py3-none-any.whl:

Publisher: python-publish.yml on YowFung/Spark-TTS-Lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page