|
|
|
|
@@ -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
|
|
|
|
|
}
|