diff options
-rwxr-xr-x | .local/bin/pashare | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/.local/bin/pashare b/.local/bin/pashare new file mode 100755 index 0000000..8413c73 --- /dev/null +++ b/.local/bin/pashare @@ -0,0 +1,38 @@ +#!/bin/sh + +# using: PulseDroidRTP +# https://github.com/wenxin-wang/PulseDroidRtp + +main () { + case "$1" in + start) + start ;; + stop) + stop ;; + *) + echo "usage: pashare [start|stop]" >&2 + ;; + esac +} + +start () { + stop &>/dev/null + + DEST=$(cat $XDG_CONFIG_HOME/pashare/dest) + + pactl load-module module-null-sink \ + sink_name=rtp \ + sink_properties=device.description=RTP \ + format=s16be \ + channels=2 \ + rate=48000 >/dev/null + + pactl load-module module-rtp-send source=rtp.monitor destination=$DEST port=4010 mtu=320 >/dev/null +} + +stop () { + pactl unload-module module-null-sink + pactl unload-module module-rtp-send +} + +main "$@" |