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.0.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.0-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

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

Hashes for spark_tts_lib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 594b59570d1db27a71ea7937a1cd39335eb0518717bfa2f19c1c053655710756
MD5 5a40045d178c23a7ca3cca4d0da2fd37
BLAKE2b-256 9a75baffad71fbea37db19307a3b7f6dbf5cf66508f1214745c0881c8add4459

See more details on using hashes here.

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

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.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

Hashes for spark_tts_lib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5b8a5c0fddf69b98ab7d1d497ec63ddc49fcd0a97dd205a823f1def0b723d5a
MD5 42496ef3f10a6e22beed3c0a567fd5d7
BLAKE2b-256 8f6bcb9a2407858876d8d890ed4dc2889249a6c1fbbd7257569043341fe70f21

See more details on using hashes here.

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

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