diff --git a/routes/dmr.py b/routes/dmr.py index bf368e9..8878219 100644 --- a/routes/dmr.py +++ b/routes/dmr.py @@ -205,6 +205,45 @@ def parse_dsd_output(line: str) -> dict | None: _HEARTBEAT_INTERVAL = 3.0 # seconds between heartbeats when decoder is idle +# 100ms of silence at 8kHz 16-bit mono = 1600 bytes +_SILENCE_CHUNK = b'\x00' * 1600 + + +def _audio_bridge(dsd_stdout, ffmpeg_stdin): + """Bridge DSD audio output to ffmpeg, inserting silence during gaps. + + Digital voice is intermittent — the decoder only outputs PCM during + active voice transmissions. Without this bridge, ffmpeg would block + waiting for its first input bytes and never write the WAV header, + causing the browser ``