Getting Started
from kittentts import KittenTTS
model = KittenTTS("KittenML/kitten-tts-mini-0.8")
Core Methods
- generate(text, voice, speed): Returns numpy audio array
- generate_to_file(text, path, voice, speed): Saves WAV file
- available_voices: List of all voice names
- normalize_text(text): Clean and normalize input text
Batch Processing
scripts = {
"intro": "Welcome to the show!",
"main": "Today we discuss the latest tech news.",
"outro": "Thanks for listening!"
}
for name, text in scripts.items():
model.generate_to_file(text, name + ".wav", voice="Jasper")
Error Handling
try:
model.generate_to_file("Test", "out.wav", voice="InvalidVoice")
except ValueError as e:
print("Voice not found:", e)