Flush ffmpeg audio stream packets

This commit is contained in:
Smittix
2026-02-04 10:06:45 +00:00
parent 40f1e3296f
commit 74155ce07c
+19 -14
View File
@@ -424,20 +424,25 @@ def _start_audio_stream(frequency: float, modulation: str):
# Ensure we use the found rx_fm path # Ensure we use the found rx_fm path
sdr_cmd[0] = rx_fm_path sdr_cmd[0] = rx_fm_path
encoder_cmd = [ encoder_cmd = [
ffmpeg_path, ffmpeg_path,
'-hide_banner', '-hide_banner',
'-loglevel', 'error', '-loglevel', 'error',
'-f', 's16le', '-fflags', 'nobuffer',
'-ar', str(resample_rate), '-flags', 'low_delay',
'-ac', '1', '-probesize', '32',
'-i', 'pipe:0', '-analyzeduration', '0',
'-acodec', 'libmp3lame', '-f', 's16le',
'-b:a', '128k', '-ar', str(resample_rate),
'-ar', '44100', '-ac', '1',
'-f', 'mp3', '-i', 'pipe:0',
'pipe:1' '-acodec', 'libmp3lame',
] '-b:a', '128k',
'-ar', '44100',
'-f', 'mp3',
'-flush_packets', '1',
'pipe:1'
]
try: try:
# Use shell pipe for reliable streaming # Use shell pipe for reliable streaming