commit 899995b012ec64851bc7e35dd81a409a4cd7d270 parent 657835ea83c43f071a2d0f7f8be110bcec55aa40 Author: Myroslav Opyr <myroslav@quintagroup.com> Date: Thu, 9 Oct 2014 21:04:51 +0300 Refactored rat-remotemic script to simplify usage and let it be used in standalone mode, as library and as autoanser slave Diffstat:
M | rat-remotemic | | | 20 | +++++++++++++------- |
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/rat-remotemic b/rat-remotemic @@ -1,10 +1,16 @@ #!/bin/sh # Remote microphone script +# Usage: +# rat-remotemic +# if no call is pending it'll initiate the call, if call is pending, i'tt be answered +# It should be called within friend dir, where call_in amd call_out pipes reside -while true; do - while grep -q 0 call_pending; do - inotifywait -t 60 -e modify call_pending; - done; - (cat call_out > /dev/null &) - arecord -r 48000 -c 1 -f S16_LE >>call_in; -done +LIBRARY_LOCATION=`dirname $BASH_SOURCE` +. $LIBRARY_LOCATION/functions + +function remotemic() { + TRASHER=$(stdin_trasher) + arecord -r 48000 -c 1 -f S16_LE - +} + +test "X$(basename -- "$0")" = "Xrat-remotemic" && remotemic < call_out > call_in