feature: implement base tts with uv and kokoro
This commit is contained in:
parent
75a87218b0
commit
4112295144
4 changed files with 2188 additions and 0 deletions
13
tts/main.py
Executable file
13
tts/main.py
Executable 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)
|
||||
8
tts/pyproject.toml
Normal file
8
tts/pyproject.toml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[project]
|
||||
name = "tts"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"kokoro>=0.9.4",
|
||||
"soundfile>=0.13.1",
|
||||
]
|
||||
2127
tts/uv.lock
generated
Normal file
2127
tts/uv.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue