summaryrefslogtreecommitdiff
path: root/.local/bin/pashare
diff options
context:
space:
mode:
authoradam <56338480+adastx@users.noreply.github.com>2022-10-09 15:26:20 +0200
committeradam <56338480+adastx@users.noreply.github.com>2022-10-09 15:26:20 +0200
commite5ce39bca66f1b6827232d420ed041645ef65d9c (patch)
treea14fc291d92415307f6f083ab9ea116172b57ebb /.local/bin/pashare
parent80ab172c62911710ea9afdee9f703f0b83658f42 (diff)
scripts: added 'pashare' for PC->Android audio
Diffstat (limited to '.local/bin/pashare')
-rwxr-xr-x.local/bin/pashare38
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 "$@"