From 0e11c919b82ea4d3a199a0ab0dedbc6364d070da Mon Sep 17 00:00:00 2001 From: itzmarkoni Date: Sun, 15 Jun 2025 22:24:33 -0400 Subject: [PATCH] updated --- speaker_driver.lua | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/speaker_driver.lua b/speaker_driver.lua index 9578e2d..43f5252 100644 --- a/speaker_driver.lua +++ b/speaker_driver.lua @@ -43,8 +43,9 @@ local function playTTSFile(value) local headers = { ["Content-Type"] = "application/x-www-form-urlencoded" } + print("Sending HTTP POST request") - local response = http.request({ + local response = http.post({ url = ttsRoute, method = "POST", body = body, @@ -52,20 +53,10 @@ local function playTTSFile(value) binary = false }) - -- Wait for the response - local event, resUrl, handle - repeat - event, resUrl, handle = os.pullEvent() - if event == "http_failure" and resUrl == url then - print("HTTP POST request failed for: " .. resUrl) - return - end - until event == "http_success" and resUrl == url print("HTTP POST request successful" ) - -- Read and parse response - local data = handle.readAll() + local data = response.readAll() print(data) - handle.close() + response.close() end local function createSoundFile(fileName)