mirror of
https://github.com/sr229/metastruct-experiments.git
synced 2024-09-20 06:30:36 +00:00
8018795e9c
Signed-off-by: Ayane Satomi <ayane@vignetteapp.org>
20 lines
No EOL
600 B
Lua
20 lines
No EOL
600 B
Lua
--@name GimpyTTS
|
|
--@author Mavain and Minori
|
|
--@client
|
|
|
|
local lang = "en"
|
|
local soundref
|
|
|
|
hook.add("playerchat", "fucke2", function(ply, txt)
|
|
if ply ~= owner() then return end
|
|
|
|
bass.loadURL("https://translate.google.com/translate_tts?ie=UTF-8&q=" .. http.urlEncode(txt) .. "&tl=" .. lang .. "&client=tw-ob", "3d",
|
|
function(a, err, name)
|
|
-- we dispose the current reference, then we create a new one
|
|
if soundref then soundref:stop() end
|
|
soundref = a
|
|
|
|
hook.add("think", "soundFollow", function() a:setPos(owner():getPos()) end)
|
|
a:play()
|
|
end)
|
|
end) |