feature: implement base tts with uv and kokoro

This commit is contained in:
mitchell 2026-04-28 02:38:10 -04:00
parent 75a87218b0
commit 4112295144
4 changed files with 2188 additions and 0 deletions

13
tts/main.py Executable file
View file

@ -0,0 +1,13 @@
from kokoro import KPipeline
import soundfile as sf
import sys
import json
text = sys.stdin.read()
pipeline = KPipeline(lang_code="a", repo_id="hexgrad/Kokoro-82M")
generator = pipeline(text, voice="af_heart", speed=1.2)
for i, (gs, ps, audio) in enumerate(generator):
print(json.dumps({"file": i, "text": gs}))
sf.write(f"{i}.wav", audio, 24000)