3 if [ "$TMPFS" == "" ]; then
9 # echo $TMPFS, $MAX_REC_TIME,
11 setMicVolume $REC_MIC_VOL
15 if [ -s $recStart ]; then # if recording was initiated
17 echo 'RECMIC' >> $TMPFS/$message # it is necessary to put message to iniciate wait loop
21 setMicVolume $REC_MIC_VOL
26 # recording TODO: fork and kill when button released
28 echo "rec start..." | myLog
31 sleep 1 # wait for arecord started
36 if [ "$cntK" -gt "$(($MAX_REC_TIME + 2))" ]; then
37 kill -15 $(cat /tmp/rec.pid)
44 # rec -c 1 "$RECTMP" gain -25 bass +60 highpass 10 trim 1 $MAX_REC_TIME
45 # rec -b 16 -c 1 -e gsm-full-rate "$RECTMP" highpass 10 trim 1 $MAX_REC_TIME
46 # rec -b 16 -c 1 "$RECTMPRAW" trim 1 $MAX_REC_TIME
47 # arecord -N --fatal-errors -r 48000 -f S16 "$RECTMPRAW" | myLog
48 # arecord -N -d $MAX_REC_TIME -r 48000 -f S16 "$RECTMPRAW" 2>&1 1>/dev/null
49 arecord -N -M -d $MAX_REC_TIME --process-id-file /tmp/rec.pid -r 48000 -f S16 "$RECTMPRAW" 2>&1 1>/dev/null
53 if [ ! -s "$NOISEPROFILE" ]; then
55 echo "noiseprof..." | myLog
56 sox "$RECTMPRAW" -n trim 0 1 noiseprof "$NOISEPROFILE"
57 playRoboMessage "Noise profile created. Now you can send audio messages to another devices."
60 # echo $DEV_JINGLE_OUT >> $TMPFS/$message
64 echo "filtering..." | myLog
65 playRoboMessage "Sound filtering"
68 # echo $DEV_JINGLE_OUT >> $TMPFS/$message
70 sox "$RECTMPRAW" "$RECTMP" noisered "$NOISEPROFILE" 0.5 lowpass 1000 norm $REC_ADD_PROCESSING
73 echo "transmition..." | myLog
76 cat /proc/net/arp | grep $BASE_IP_MASK | awk '{print $1}' | while read -r IP ; do
77 # echo 20.0.0.126 | while read -r IP ; do
78 # cat "$RECTMP" | netcat $IP 1234
79 echo "cat "$RECTMP" | socat - TCP:$IP:1234" | myLog
80 cat "$RECTMP" | socat - TCP:$IP:1234
84 echo "transmition complete" | myLog
92 ## echo $DEV_JINGLE_OUT >> $TMPFS/$message