Browser updates.

This commit is contained in:
Storm Dragon committed 2026-10-16 19:33:18 -04:00
1 parent 2fa9bc8724
commit 423590e11a
31 files changed
+1056 -70

No files matched your search

+9 -6
View File
@@ -76,18 +76,21 @@ class PreviewSpeechServer:
target = self.clients[targetId]
if target["active"] is not None:
self.finish(targetId, target, target["active"], canceled=True)
elif command == "SPEAK":
elif command == "SPEAK" or command.startswith("CHAR "):
parts = []
for line in stream:
if line == b".\r\n":
break
parts.append(line.decode().rstrip("\r\n"))
if command == "SPEAK":
for line in stream:
if line == b".\r\n":
break
parts.append(line.decode().rstrip("\r\n"))
else:
parts.append(command.removeprefix("CHAR "))
record = {"text": "\n".join(parts), "module": client["module"],
"voice": client["voice"], "finished": False, "canceled": False}
with self.lock:
self.spoken.append(record)
client["active"] = record
self.reply(client, "230 OK\r\n200 QUEUED\r\n")
self.reply(client, "230 OK\r\n200 QUEUED\r\n" if command == "SPEAK" else "225 QUEUED\r\n")
if client["notifications"]:
self.reply(client, f"701-1\r\n701-{clientId}\r\n701 BEGIN\r\n")
timer = threading.Timer(0.25, self.finish, args=(clientId, client, record))