updated params

This commit is contained in:
2025-06-15 21:21:47 -04:00
parent 689fccd33f
commit 7734f2b354
4 changed files with 32 additions and 12 deletions

View File

@@ -1,6 +1,7 @@
local dfpwm = require("cc.audio.dfpwm")
local encoder = dfpwm.make_encoder()
local decoder = dfpwm.make_decoder()
local baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/"
local function getFileName(name)
local extension = ".dfpwm"
@@ -33,13 +34,22 @@ local function playInternalAlarm(speakers)
playSound(speakers,"internal_alarm")
end
local function playTTSFile()
-- local ttsRoute = "https://ttsmp3.com/makemp3_new.php"
-- local fileName = "tts"
-- local response = http.request({
-- url = url,
-- method = "POST",
-- body = body,
-- headers = headers,
-- binary = false
-- })
end
local function createSoundFile(fileName)
--local placeholder = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/placeholder.dfpwm"
local baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/"
local name = getFileName(fileName)
local fullPath = baseRoute .. name
shell.execute("rm", name)
local response = http.request({
url = fullPath,
@@ -47,6 +57,7 @@ local function createSoundFile(fileName)
binary = true
})
local event, url, handle
repeat
event, url, handle = os.pullEvent()
@@ -99,4 +110,13 @@ end
local function report()
end
return { report = report, watch = watch, startup = startup, shutdown = shutdown, playControlRoomAlarm = playControlRoomAlarm, addSoundFile = addSoundFile, playExternalAlarm = playExternalAlarm, playInternalAlarm = playInternalAlarm }
return { report = report,
watch = watch,
startup = startup,
shutdown = shutdown,
playControlRoomAlarm = playControlRoomAlarm,
addSoundFile = addSoundFile,
playExternalAlarm = playExternalAlarm,
playInternalAlarm = playInternalAlarm,
playTTSFile = playTTSFile
}