File size: 654 Bytes
f5647fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import base64
import json

import requests

text = """the administration has offered up a platter of repression for more than a year and is still slated to lose $400 million.

Columbia is the largest private landowner in New York City and boasts an endowment of $14.8 billion;"""


Type = "wav"

response = requests.post(
    "http://localhost:8880/v1/audio/speech",
    json={
        "model": "kokoro",
        "input": text,
        "voice": "af_heart+af_sky",
        "speed": 1.0,
        "response_format": Type,
        "stream": False,
    },
    stream=True,
)

with open(f"outputnostreammoney.{Type}", "wb") as f:
    f.write(response.content)