From e5ce39bca66f1b6827232d420ed041645ef65d9c Mon Sep 17 00:00:00 2001 From: adam <56338480+adastx@users.noreply.github.com> Date: Sun, 9 Oct 2022 15:26:20 +0200 Subject: scripts: added 'pashare' for PC->Android audio --- .local/bin/pashare | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 .local/bin/pashare (limited to '.local/bin') 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 "$@" -- cgit v1.2.3-70-g09d2