Implementation of KittenTTS
Project description
KittenTTS Example
This project demonstrates how to use the KittenTTS text-to-speech model to convert text into a .wav audio file.
Features
- Convert any given text into natural-sounding speech.
- Choose a specific voice for the generated audio.
- Control the playback speed.
Requirements
Install the required Python packages:
pip install KittenTTS
Usage
Below is a minimal working example:
import soundfile as sf
from kittentts import KittenTTS
# Initialize the model
model = KittenTTS()
# Generate speech
audio_data = model.generate(
text="hi who are you",
voice="expr-voice-2-m",
speed=1.0
)
# Save output as a WAV file
sf.write("test.wav", audio_data, 24000)
Parameters
- text (str): The text you want to convert to speech.
- voice (str): The voice preset to use (e.g.,
"expr-voice-2-m"). - speed (float): Playback speed multiplier (1.0 = normal speed).
Reference
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
kittentts-0.1.0.tar.gz
(2.3 kB
view details)
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 kittentts-0.1.0.tar.gz.
File metadata
- Download URL: kittentts-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f54ee8c6bb00802541b92688017184d16220e310004133973061e262f228473f
|
|
| MD5 |
731df7bc2f5032f64d221534d5201872
|
|
| BLAKE2b-256 |
86c6007e40b7e6f0c071ae215ec4595475b89ce3ba4c8b59ea4c3877b89c5211
|
File details
Details for the file kittentts-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: kittentts-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16a5bc70e930693c39523674bb8ce05954b1359444bf1e3750df2521d4b85773
|
|
| MD5 |
0cadd33234373e8f249ade675b08ccfd
|
|
| BLAKE2b-256 |
6fbc6e404eb71726f0ec7f87becaacf7d0b7ac4d3535b5fde36934213e5fd4f3
|