File Change

op25-container/system.pa	New PulseAudio config: auth-anonymous=1 so the edge-node can connect without group membership
op25-container/Dockerfile	Copies system.pa into /etc/pulse/system.pa
drb-edge-node/Dockerfile	Added libpulse0 — ffmpeg needs this runtime library to use -f pulse
drb-edge-node/app/internal/call_recorder.py	Switched recording from Icecast (burst-buffer overlap) to PulseAudio monitor (zero-delay, exact call boundaries)
This commit is contained in:
Logan
2026-04-11 21:16:32 -04:00
parent d201d8124e
commit fb86d79930
4 changed files with 28 additions and 6 deletions
+1
View File
@@ -4,6 +4,7 @@ RUN apt-get update && apt-get install -y \
ffmpeg \
libopus0 \
libopus-dev \
libpulse0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
+7 -5
View File
@@ -15,9 +15,6 @@ class CallRecorder:
self._process: Optional[asyncio.subprocess.Process] = None
self._current_call_id: Optional[str] = None
self._current_file: Optional[Path] = None
self._icecast_url = (
f"http://{settings.icecast_host}:{settings.icecast_port}{settings.icecast_mount}"
)
self._recordings_dir = Path(settings.recordings_path)
async def start_recording(self, call_id: str) -> bool:
@@ -30,10 +27,15 @@ class CallRecorder:
self._current_file = self._recordings_dir / f"{ts}_{call_id}.mp3"
self._current_call_id = call_id
# Read directly from the PulseAudio monitor source (zero-delay, no Icecast burst buffer).
# PULSE_SERVER env var is set in the container environment.
cmd = [
"ffmpeg", "-y",
"-i", self._icecast_url,
"-acodec", "copy",
"-f", "pulse",
"-i", "default.monitor",
"-acodec", "libmp3lame",
"-ar", "22050",
"-b:a", "32k",
"-t", str(MAX_RECORDING_SECONDS),
str(self._current_file),
]