Skip to content

Instantly share code, notes, and snippets.

@Fusl
Last active September 21, 2025 01:15
Show Gist options
  • Save Fusl/3a708b8c32c9d5264fa0 to your computer and use it in GitHub Desktop.
Save Fusl/3a708b8c32c9d5264fa0 to your computer and use it in GitHub Desktop.
Streaming audio output from Linux (Pulseaudio) to Windows
# Windows (receiver) side:
.\ffplay.exe -nodisp -ac 2 -acodec pcm_u8 -ar 48000 -analyzeduration 0 -probesize 32 -f u8 -i udp://0.0.0.0:18181?listen=1
# Linux (transmitter) side:
pactl load-module module-null-sink sink_name=remote
ffmpeg -f pulse -i "remote.monitor" -ac 2 -acodec pcm_u8 -ar 48000 -f u8 "udp://RECEIVER:18181"
pavucontrol # Change the default output to the Null sink or move single applications to this "output" device.
@LordXerus
Copy link

LordXerus commented May 26, 2025

I tried incorporating a tcp version using https://0110.be/posts/Sending_audio_over_a_network_with_ffmpeg

Note that as of ffmpeg 7.0, -ac 2 seems to have been removed so you can't use it anymore. Instead, use -af aformat=channel_layout=stereo instead.

Receiver: ffplay -nodisp -fflags low_delay -strict-experimentals -fflags discardcorrupt -af aformat=channel_layouts=stereo -analyzeduration 0 -probesize 32 -mpegts "tcp://0.0.0.0:18181?listen=1"

Null Sink: pactl load-module module-null-sink sink_name=remote
Sender: ffmpeg -f pulse -i "remote.monitor" -acodec libmp3lame -ab 196k -f mpegts "tcp://10.42.0.1:18181"

@PlayF0R3v3R
Copy link

Sorry to bother but could somebody please update the commands? From Linux to Windows

@LordXerus
Copy link

@PlayF0R3v3R If you look at the link to 0110.be I sent last post, the sender takes input using avfoundation for mac. I use -f pulse for linux. I'm not sure what the corresponding input device for windows is but you could start by changing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment