Skip to main content

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:

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

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.2.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

kittentts-0.1.2-py2.py3-none-any.whl (2.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file kittentts-0.1.2.tar.gz.

File metadata

  • Download URL: kittentts-0.1.2.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.17

File hashes

Hashes for kittentts-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fe9daa514fff667098d279b19477315269138a3f77a8b4a17920118a008d9608
MD5 37cea5eba421af3b319d2fac8ca46e10
BLAKE2b-256 9bc41acaad48ce6f50f9f508990bfa188f4d3434e01828b4d4228502726fba5f

See more details on using hashes here.

File details

Details for the file kittentts-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for kittentts-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 822a6d8b36aef0f902763c18a5a3e2b95533916acaae5f68b51ad0f457c18a68
MD5 29d60cc30719c6e01a9ee6aa3d45f3d2
BLAKE2b-256 b3387080722fa438126854104c07e59a41c09979a309d6ff745867c955119ad4

See more details on using hashes here.

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