4 ms·
Nice line, but you don't actually need all those separate greps and cats. You can do: while true; do sox -t .wav "|arecord -d 1" -n stat 2> /tmp/tmp; echo -n $
by phaemon 14y ago
Nice line, but you don't actually need all those separate greps and cats. You can do:
while true; do sox -t .wav "|arecord -d 1" -n stat 2> /tmp/tmp; echo -n $( date +%Y%m%d%H%M%S ); grep -e "Maximum amplitude" -e "Midline amplitude" -e "Rough *frequency" /tmp/tmp | cut -d ":" -f 2 | tr -d "\n"; echo; done
Shortening a line like this reminds me of a discussion on a forum about picking a random movie to play. It started off with loops and scripts of all kinds, and eventually ended with "shuf" :)