Kokoro-FastAPI/dev/Test money.py

26 lines
505 B
Python
Raw Normal View History

import base64
import json
2025-04-04 16:50:46 -06:00
import requests
2025-05-28 14:53:00 +00:00
text = """奶酪芝士很浓郁!臭豆腐芝士有争议?陈年奶酪价格昂贵。"""
2025-04-04 16:58:07 -06:00
Type = "wav"
response = requests.post(
"http://localhost:8880/v1/audio/speech",
json={
"model": "kokoro",
"input": text,
2025-05-28 14:53:00 +00:00
"voice": "zf_xiaobei",
"speed": 1.0,
"response_format": Type,
"stream": False,
},
2025-04-04 16:58:07 -06:00
stream=True,
)
with open(f"outputnostreammoney.{Type}", "wb") as f:
f.write(response.content)