Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

Generate input

sox -r 44100 -n -b 16 -c 2 input.wav synth 1800 vol -1dB

Record output

parec -d <sink>.monitor | sox -t raw -b 16 -e signed -c 2 -r 44100 - output.wav

Render plot

./ ./output-roc.wav ./output-pulse-native.wav ./output-pulse-rtp.wav


On receiver:

roc-recv -vv -s :10003 -r :10004 --latency 250ms --nbsrc=17 --nbrpr=17

On sender:

roc-send -vv -s <receiver-ip>:10003 -r <receiver-ip>:10004 -i ./input.wav --nbsrc=17 --nbrpr=17

PulseAudio "native"

On receiver:

sudo /etc/init.d/avahi-daemon start
pactl load-module module-native-protocol-tcp listen= auth-anonymous=1
pactl load-module module-zeroconf-publish

On sender:

pactl load-module module-zeroconf-discover
./ffmpeg_decode ./input.wav | ./pa_play_async_poll 250 >/dev/null

Tools are available here and here.

PulseAudio RTP

On receiver:

pactl load-module module-rtp-recv sap_address= latency_msec=250

On sender:

pactl load-module module-null-sink sink_name=rtp
pactl load-module module-rtp-send source=rtp.monitor destination_ip=<receiver-ip>
play ./input.wav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment