commit | author | age
|
4ce3ae
|
1 |
#!/bin/sh |
JG |
2 |
server_port=8000 |
|
3 |
ip_address=$(ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p') |
|
4 |
pulse_source=$(pactl list sources short | grep analog-stereo.monitor | awk '{print $2}') |
|
5 |
case "$1" in |
|
6 |
start) |
|
7 |
$0 stop |
|
8 |
pactl load-module module-simple-protocol-tcp rate=48000 format=s16le channels=2 source=$pulse_source record=true port=$server_port |
|
9 |
;; |
|
10 |
stop) |
|
11 |
pactl unload-module `pactl list | grep tcp -B1 | grep M | sed 's/[^0-9]//g'` |
|
12 |
;; |
|
13 |
*) |
|
14 |
echo "Usage: $0 start|stop" >&2 |
|
15 |
;; |
|
16 |
esac |