Skip to content

Instantly share code, notes, and snippets.

@maurges
Created May 31, 2019 16:36
Show Gist options
  • Select an option

  • Save maurges/179f8405c15b3aef69f3fb07d9d41eee to your computer and use it in GitHub Desktop.

Select an option

Save maurges/179f8405c15b3aef69f3fb07d9d41eee to your computer and use it in GitHub Desktop.
Create a pulseaudio rtp stream
#!/bin/bash
# Create a pulseaudio rtp stream
# Run a script, then set <rtpcombine> as your default stream, then connect to it from other device
# check if combined sink already exists
pacmd list-sinks | grep -Fq 'name: <rtpcombine>' && echo "Combined stream already exists" && exit 0
# load rtp modules
pactl load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
pactl load-module module-rtp-send source=rtp.monitor
# combine all sinks into one
all_sinks=`pacmd list-sinks | grep name: | awk '{print $2}' | cut -c 2- | sed 's/>$//' | paste -sd "," -`
pactl load-module module-combine-sink sink_name=rtpcombine slaves=$all_sinks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment