projects
/
air-quality
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
630adef
)
better filter for sox output
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 11 Jan 2020 08:20:39 +0000
(09:20 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 11 Jan 2020 08:20:39 +0000
(09:20 +0100)
audio2mqtt.sh
patch
|
blob
|
history
diff --git
a/audio2mqtt.sh
b/audio2mqtt.sh
index
cb7e9f5
..
af23cbb
100755
(executable)
--- a/
audio2mqtt.sh
+++ b/
audio2mqtt.sh
@@
-4,7
+4,7
@@
while true ; do
arecord -d 1 -r 96000 /dev/shm/tmp.wav
time=`date +'%s%N'`
-info=`sox /dev/shm/tmp.wav -n stat 2>&1 |
sed -e 's/(.*)//' -e 's/: */=/' -e 's/ */_/g' | tr '\n' ',' | sed 's/,
$//'`
+info=`sox /dev/shm/tmp.wav -n stat 2>&1 |
grep '[0-9][0-9][0-9]*$' | sed -e 's/[()]//g' -e 's/: */=/' -e 's/ */_/g' | tr '\n' ',' | sed 's/[, ]*
$//'`
curl --silent -XPOST http://10.60.0.92:8086/write?db=rot13 --data-binary "fan,dc=trnjanska $info $time"
done