Skip to main content

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:

apt install espeak
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

https://github.com/KittenML/KittenTTS

Implementation with GUI

https://huggingface.co/spaces/shethjenil/KittenTTS

Metadata

Release files for kittentts 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kittentts 0.1.3
File Size Uploaded
kittentts-0.1.3.tar.gz 2.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kittentts 0.1.3
File Interpreter ABI Platform
kittentts-0.1.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 4.9 kB

Release files / kittentts-0.1.3.tar.gz

Download URL kittentts-0.1.3.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e48cc069f84c09817a38c77920e9567cf0b65ab980deb46ff94a61669364cf1a
BLAKE2b-256 checksum
How to use checksums
34a0205826d5d3b962f1fa9ec10f860630454f196dda5259bd10485a7ca1cae3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.17

Release files / kittentts-0.1.3-py2.py3-none-any.whl

Download URL kittentts-0.1.3-py2.py3-none-any.whl
Size 2.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
da41beef7e5a13201f849d5e688a978fabd8cdd196250816e7a07972d6aacf43
BLAKE2b-256 checksum
How to use checksums
0bbc3d24d68f666dcd853b38eda1a44e722ea3ddcfc9b415f18d9024bd477ef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.17

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page