updated
This commit is contained in:
@@ -49,44 +49,6 @@ local function playTTSFile(speakers, value)
|
||||
os.pullEvent("speaker_audio_empty")
|
||||
end
|
||||
end
|
||||
-- local ttsRoute = "https://ttsmp3.com/makemp3_new.php"
|
||||
-- local fileName = "tts.dfpwm"
|
||||
-- local encodedValue = textutils.urlEncode(value)
|
||||
-- print("Encoded TTS value: " .. encodedValue)
|
||||
-- local body = "msg=" .. encodedValue .. "&lang=Gwyneth&source=ttsmp3"
|
||||
-- local headers = {
|
||||
-- ["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
-- }
|
||||
|
||||
-- print("Sending HTTP POST request")
|
||||
-- local response = http.post({
|
||||
-- url = ttsRoute,
|
||||
-- method = "POST",
|
||||
-- body = body,
|
||||
-- headers = headers,
|
||||
-- binary = false
|
||||
-- })
|
||||
|
||||
-- print("HTTP POST request successful" )
|
||||
-- local data = response.readAll()
|
||||
-- response.close()
|
||||
|
||||
-- local responseData = textutils.unserialiseJSON(data, { parse_null = true })
|
||||
-- local soundRequest = http.get({
|
||||
-- url = responseData.URL,
|
||||
-- binary = true
|
||||
-- })
|
||||
|
||||
-- local soundData = soundRequest.readAll()
|
||||
-- soundRequest.close()
|
||||
|
||||
-- local encodedData = encoder.encode(soundData)
|
||||
|
||||
-- local file = fs.open(fileName, "w")
|
||||
-- file.write(encodedData)
|
||||
-- file.close()
|
||||
|
||||
-- playSound(speakers, fileName)
|
||||
end
|
||||
|
||||
local function createSoundFile(fileName)
|
||||
|
||||
Reference in New Issue
Block a user