3 if [ "$TMPFS" == "" ]; then
11 echo $VOLDEF > $TMPFS/$volume
16 tail -F $TMPFS/$message | while read MSG; do
18 if [ "$MSG" != "" ]; then
20 currentVolume=$(cat $TMPFS/$volume)
22 # ---------------- fade out TODO: add curretn PLAY detection ----------------
26 if echo $MSG | grep -q "RECMIC"; then
27 echo "MESSAGE" > $TMPFS/$state
28 ## while killall madplay 2> /dev/null; do sleep 0; done
29 while kill -15 $(pidof madplay) 2> /dev/null; do sleep 0; done
30 while [ -s $recStart ]; do
32 printf 'rec mic' | myLog
33 done # wait for MIC recording complete
34 echo "play JINGLE OUT..." | myLog
35 currentL=$(cat $TMPFS/$currentLang)
36 playFile 0 "$CONTENT/$currentL/$SYSMESSAGES/$DEV_JINGLE_OUT"
39 if echo $MSG | grep -q ".language"; then # skip fade out on LANGUAGE CHANGE
43 # echo "drop fade out"
46 while [ "$vol" -ge "$VOLMIN" ]; do
48 vol=$(($vol-$VOLSTEP))
52 # echo "norm fade out"
55 echo "MESSAGE" > $TMPFS/$state
57 # while killall madplay 2> /dev/null; do sleep 0; done
58 while kill -15 $(pidof madplay) 2> /dev/null; do sleep 0; done
60 # ---------------- play the message -----------------------------------------
62 setVolume $currentVolume
64 echo $MSG | tr "|" "\n" | while read file; do
66 currentL=$(cat $TMPFS/$currentLang)
68 echo "Playing message: $file" | myLog
70 fileext=$(echo $file | awk -F. '{print (NF>1?$NF:"no extension")}')
72 if [ "$fileext" == "mp3" ]; then
74 playFile 0 "$CONTENT/$currentL/$SYSMESSAGES/$file"
76 # mute for shutdown process
78 if [ "$file" == "$DEVICE_OFF" ]; then
84 playRecMessage "$file"
94 # ---------------- fade in TODO: add curretn PLAY detection -----------------
100 while [ "$vol" -le "$currentVolume" ]; do
102 vol=$(($vol+$VOLSTEP))