diff --git a/routes/listening_post.py b/routes/listening_post.py index 4b59d5a..ac1dbe3 100644 --- a/routes/listening_post.py +++ b/routes/listening_post.py @@ -424,20 +424,25 @@ def _start_audio_stream(frequency: float, modulation: str): # Ensure we use the found rx_fm path sdr_cmd[0] = rx_fm_path - encoder_cmd = [ - ffmpeg_path, - '-hide_banner', - '-loglevel', 'error', - '-f', 's16le', - '-ar', str(resample_rate), - '-ac', '1', - '-i', 'pipe:0', - '-acodec', 'libmp3lame', - '-b:a', '128k', - '-ar', '44100', - '-f', 'mp3', - 'pipe:1' - ] + encoder_cmd = [ + ffmpeg_path, + '-hide_banner', + '-loglevel', 'error', + '-fflags', 'nobuffer', + '-flags', 'low_delay', + '-probesize', '32', + '-analyzeduration', '0', + '-f', 's16le', + '-ar', str(resample_rate), + '-ac', '1', + '-i', 'pipe:0', + '-acodec', 'libmp3lame', + '-b:a', '128k', + '-ar', '44100', + '-f', 'mp3', + '-flush_packets', '1', + 'pipe:1' + ] try: # Use shell pipe for reliable streaming