# Сгенерировать озвучку
curl https://golosar.tech/api/tts \
-H "Authorization: Bearer $GOLOSAR_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Привет! Это Голосарь.",
"speaker": "Артём",
"language": "Русский"
}'
const response = await fetch("https://golosar.tech/api/tts", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.GOLOSAR_KEY,
"Content-Type": "application/json"
},
body: JSON.stringify({
text: "Привет! Это Голосарь.",
speaker: "Артём",
language: "Русский"
})
});
const audio = Buffer.from(await response.arrayBuffer());
await fs.promises.writeFile("out.wav", audio);
import os, requests
response = requests.post(
"https://golosar.tech/api/tts",
headers={
"Authorization": f"Bearer {os.environ['GOLOSAR_KEY']}",
"Content-Type": "application/json",
},
json={
"text": "Привет! Это Голосарь.",
"speaker": "Артём",
"language": "Русский",
},
)
open("out.wav", "wb").write(response.content)