Frost TTS
Лучший синтез речи популярных персонажей за копейки. Поддерживает любые интеграции: Garry's Mod, Space Station, Стримы и т.д.
Работаем с компаниями и физ. лицами.
10+
Голосов
~50ms
Скорость
1000
Символов в запросе
100+
Запросов/сек КАЖДОМУ
Примеры голосов
Артас - WarCraft 3
0:00 / 0:00
Пудж - Dota 2
0:00 / 0:00
Орк - WarCraft 3
0:00 / 0:00
Трент - Dota 2
0:00 / 0:00
Мев - WarCraft 3
0:00 / 0:00
API
POST
/get_apikey
▼
Получить API ключ по логину/паролю.
Параметры
user
string
логин
pass
string
пароль
{"apikey": "xxx"}
GET
/tts
▼
Генерация речи: Возвращает audio/wav.
Параметры
key
string
API ключ
model
int
ID голоса
text
string
текст (до 1000 символов)
speed
float
скорость, default 1.0
GET /tts?key=xxx&model=1&text=привет&speed=1.0
GET
/get_models
▼
Список доступных голосов.
{"models": [
{"id": 1, "name": "Анубарак", "category": "WarCraft"},
{"id": 16, "name": "Пудж", "category": "Dota 2"}
]}
Получение API ключа
curl -X POST "https://api.animeworld.space/get_apikey" \
-d "user=your_login" \
-d "pass=your_password"
Ответ:
{"apikey": "xxx"}
Генерация речи
# Сохранить аудио в файл
curl -X POST "https://api.animeworld.space/tts" \
-d "text=Привет, мир!" \
-d "key=XXX" \
-d "model_id=1" \
--output speech.wav
Ответ (format=url):
{"url": "https://api.animeworld.space/temp/abc123.wav"}
Список голосов
curl "https://api.animeworld.space/get_models"
Server
TTSKey = TTSKey or nil
-- Получение и обновление ключа каждые 5 минут
timer.Create("TTSKeyUpdate", 300, 0, function()
http.Post("https://api.animeworld.space/get_apikey", {
user = "login",
pass = "password"
}, function(body)
local data = util.JSONToTable(body)
if data and data.apikey then
TTSKey = data.apikey
for _, ply in pairs(player.GetAll()) do
ply:SetNWString("TTSKey", TTSKey)
end
else
print("Ошибка получения ключа:", body)
end
end, function(err) print("HTTP ошибка:", err) end)
end)
-- Выдача ключа и модели при входе игрока
hook.Add("PlayerInitialSpawn", "ChangeTTSVoice", function(ply)
if not IsValid(ply) then return end
ply:SetNWString("TTSModel", ply:GetInfo("TTSModel"))
ply:SetNWString("TTSKey", TTSKey)
end)
-- Команда смены голоса
concommand.Add("ChangeTTSVoice", function(ply, cmd, args)
local model = args[1]
if not model then return end
ply:SetNWString("TTSModel", model)
end)
Client
local function URLToStr(text)
return text:gsub("([^%w%-%.%_%d])", function(c)
return string.format("%%%02X", string.byte(c))
end)
end
local stations = {}
CreateClientConVar('TTSModel', '', true, true)
-- Получение списка голосов
http.Fetch("http://api.animeworld.space/get_models", function(body)
print(body)
end)
-- Пример хуков для разных режимов:
-- DarkRP: OnPlayerChat
-- Helix: MessageReceived
-- NutScript: OnChatReceived
hook.Add("OnPlayerChat", "TTSVoice", function(ply, strText, bTeam, bDead)
if not IsValid(ply) or not ply:IsPlayer() then return end
if ply ~= LocalPlayer() and ply:IsMuted() then return true end
local model = ply:GetNWString('TTSModel', '')
if model == '' then return end
if IsValid(stations[ply]) then stations[ply]:Stop() end
sound.PlayURL('https://api.animeworld.space/tts?key=' .. LocalPlayer():GetNWString('TTSKey') .. '&model=' .. model .. '&text=' .. URLToStr(strText), '3d', function(station)
if not IsValid(station) or not IsValid(ply) then return end
station:SetPos(ply:GetPos())
station:SetVolume(0.7)
stations[ply] = station
end)
end)
hook.Add("EntityRemoved", "TTSVoiceCleanup", function(ent)
if IsValid(stations[ent]) then stations[ent]:Stop() end
stations[ent] = nil
end)
Для получения моделей используй
http.Fetch на http:// (не https) - GMod блокирует SSL на клиенте.
Простой пример генерации и сохранения аудио.
import requests
# Получить ключ
key = requests.post("https://api.animeworld.space/get_apikey", data={"user": "login", "pass": "password"}).json()["apikey"]
# Сгенерировать речь
audio = requests.get("https://api.animeworld.space/tts", params={"key": key, "model": 1, "text": "Привет мир"})
open("output.wav", "wb").write(audio.content)
# Список моделей
print(requests.get("https://api.animeworld.space/get_models").json())
Бесплатный тестовый период!
Далее 1000₽/мес если понравится, без лимитов на запросы.