Created
April 8, 2018 10:40
-
-
Save Pillar1989/e2778d34b2253e8133e6201f1ba8cf45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
c="true" | |
count=0 | |
while c=="true" | |
do | |
d="true" | |
python3 recorder.py > log.txt | |
cat log.txt | grep "channel: 0 RMS: " | awk -F':' '{print $NF}' | while read LINE | |
do | |
echo ${LINE} | |
if [ "${LINE}" = "0 dB" ]; then | |
echo "get it" | |
d="false" | |
fi | |
if [ "${LINE}" = "\-inf dB" ]; then | |
echo "get it" | |
d="false" | |
fi | |
done | |
# x=$(cat log.txt | grep "channel: 0 RMS: " | grep "0 dB" | awk -F':' '{print $NF}') | |
# echo ${x} | |
# if [ ${x} ]; then | |
# break | |
# fi | |
# x=$(cat log.txt | grep "channel: 0 RMS: " | grep "\-inf dB" | awk -F':' '{print $NF}') | |
# if [ ${x} ]; then | |
# break | |
# fi | |
if [ "${d}" = " false" ]; then | |
break | |
fi | |
sleep 1 | |
count=$((count + 1)) | |
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${count}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment