Skip to main content

A Python library for voice cloning using Spark-TTS.

Project description

Spark-TTS-Lib

A Python library for Spark-TTS

Hugging Face version version python mit

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


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.1.0.tar.gz (322.9 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.1.0-py3-none-any.whl (56.2 kB view details)

Uploaded Python 3

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

Hashes for spark_tts_lib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1edaf50f325eeec77ae48b9eb7841a48428f9f69a871c77f40032cf57cfd334a
MD5 13b2a7901c01548a8101aa9afb83d5f5
BLAKE2b-256 e187376594262b722df640922dd457af98a2049acfd212a5dec697ba94203a6b

See more details on using hashes here.

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

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

Hashes for spark_tts_lib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb9dfc33013e83ed074af61989f4131be10e792863d8087ba5dbf615a3f82faf
MD5 8aebfcc87409fbe510dada64d92f2c43
BLAKE2b-256 b2e4a08aac3b7084a6cb5642c74d929f90607cf927acf60b43d71017d983b5e8

See more details on using hashes here.

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

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