mirror of
https://github.com/sr229/metastruct-experiments.git
synced 2024-09-20 14:40:35 +00:00
Simplify DECTalk conditional
Signed-off-by: Ayane Satomi <ayane@vignetteapp.org>
This commit is contained in:
parent
96350afbdb
commit
e287600e26
1 changed files with 6 additions and 9 deletions
|
@ -30,7 +30,7 @@ function itExists(table, val)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function speak(ent, txt, remote, variant)
|
function TTSLib:speak(ent, txt, remote, variant)
|
||||||
if not itExists(remoteList, remote) then
|
if not itExists(remoteList, remote) then
|
||||||
print(remote .. " Does not exist in this context")
|
print(remote .. " Does not exist in this context")
|
||||||
else
|
else
|
||||||
|
@ -40,7 +40,7 @@ function speak(ent, txt, remote, variant)
|
||||||
if not itExists(sapi4Voices, variant) then
|
if not itExists(sapi4Voices, variant) then
|
||||||
print("Invalid voice argument, valid voices are: Sam, Mike, Mary")
|
print("Invalid voice argument, valid voices are: Sam, Mike, Mary")
|
||||||
else
|
else
|
||||||
url = string.format(remoteList[1], voice)
|
url = string.format(remoteList[1], variant)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -48,17 +48,14 @@ function speak(ent, txt, remote, variant)
|
||||||
if not itExists(googleVoices, variant) then
|
if not itExists(googleVoices, variant) then
|
||||||
print("Invalid voice argument, valid voices are: en, fr, jp")
|
print("Invalid voice argument, valid voices are: en, fr, jp")
|
||||||
else
|
else
|
||||||
url = string.format(remoteList[2], variant, txt)
|
url = string.format(remoteList[2], variant)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if remote == "dectalk" then
|
if remote == "dectalk" then
|
||||||
if variant ~= nil then
|
-- Ignore arguments here
|
||||||
print("Warning: DECTalk does not have arguments, ignoring.")
|
-- DECTalk only has one variant
|
||||||
url = remote[3]
|
url = remote[3]
|
||||||
else
|
|
||||||
url = remote[3]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
http.get(url .. http.urlEncode(text), function(code, body)
|
http.get(url .. http.urlEncode(text), function(code, body)
|
||||||
|
|
Loading…
Reference in a new issue