feat: point the fleet at wss LiveKit room uwh-telhai

Publish and subscribe over wss://livekit.uni-wh.de:7800 and refuse
cleartext ws://. Conference room is uwh-telhai. Includes the uncommitted
encoded H.264 publish path, Rally hairpin, and KMS wall overlay.
This commit is contained in:
root
2026-10-11 00:48:50 +00:00
parent ef9573c294
commit 95bb7c50ee
89 changed files with 9883 additions and 243 deletions
+52 -1
View File
@@ -32,6 +32,8 @@ import time
import numpy as np
from audio_gate import hop_mono_int16
log = logging.getLogger("audio.cleanup")
SAMPLE_RATE = 16000
@@ -66,7 +68,10 @@ class AudioCleaner:
beamform: str = "auto",
torch_num_threads: int = 1,
tdoa_every: int = 5,
enhance_infer: str = "auto"):
enhance_infer: str = "auto",
enhance_socket: str = "",
identity: str = "",
gate=None):
self.mode = mode
self.beamform_mode = beamform
self.sample_rate = sample_rate
@@ -93,6 +98,19 @@ class AudioCleaner:
self._ov_compiled = None
self._ov_request = None
self._ov_input = None
self.enhance_socket = (enhance_socket or "").strip()
self.identity = identity or ""
self._client = None
self._gate = gate
if self.enhance_socket and mode != "off":
self._connect_daemon()
if self._client is not None:
return
if mode == "force":
raise RuntimeError(
f"ENHANCE_MODE=force but enhance daemon "
f"{self.enhance_socket!r} is unreachable")
self._load_torch()
if beamform == "force":
@@ -121,6 +139,19 @@ class AudioCleaner:
self._refresh_backend()
def _connect_daemon(self) -> None:
from enhance_ipc import EnhanceClient
try:
self._client = EnhanceClient(self.enhance_socket)
except Exception as e: # noqa: BLE001
log.warning("enhance daemon %s unreachable (%s)", self.enhance_socket, e)
self._client = None
return
self.backend = "daemon"
log.info("audio enhance via daemon %s identity=%s",
self.enhance_socket, self.identity or "-")
def _refresh_backend(self) -> None:
parts = []
if self._enhancer is not None:
@@ -323,6 +354,11 @@ class AudioCleaner:
pcm = np.asarray(pcm)
t0 = time.perf_counter()
try:
if self._gate is not None:
n = pcm.shape[0]
self._gate.apply(hop_mono_int16(pcm))
if not self._gate.open:
return np.zeros(n, dtype=np.int16)
return self._process_inner(pcm)
finally:
self.last_dt_ms = (time.perf_counter() - t0) * 1000.0
@@ -340,6 +376,21 @@ class AudioCleaner:
n = frames.shape[0]
x = frames.astype(np.float32) / 32768.0
if self._client is not None:
try:
out = self._client.process(self.identity, frames.astype(np.int16))
out = np.asarray(out, dtype=np.int16)
if out.shape[0] != n:
if out.shape[0] > n:
out = out[:n]
else:
out = np.pad(out, (0, n - out.shape[0]))
return out
except Exception as e: # noqa: BLE001
log.warning("enhance daemon failed (%s); using fallback", e)
mono_hop = frames.astype(np.float32).reshape(n, -1).mean(axis=1) / 32768.0
return self._to_int16(self._simple_clean(mono_hop))
# Delay-and-Sum the *hop* (200 ms is ~60 ms here). Beamforming the
# full 1 s window every hop is ~330 ms — not 20-camera real-time.
# Same tutorial modules; TDOA is estimated per hop via GCC-PHAT.