Monitoring sound over time for long periods to see trends using a microphone
Recently a post was made requesting a solution to detecting sound in a studio to see if it is populated with lots of noise (lots of noise=people/bands playing) this way the person monitoring it wouldn't have to go through the trouble of hulking all their stuff to the studio.
I posted an interesting solution so I'm sharing it here and a little more on this blog. See post #9 of this thread.
I'm going to expand upon that munin plugin and make it a little more robust and informative. I'll rewrite the munin plugin a bit to include more information on the same graph and be a little better.
Of course, that plugin can be further improved by writing an awk script which parses out all of the values and displays all three values at once that way the sox command is only run once and it uses less CPU. Though power savings will be almost negligible by doing that. I kept it this way for readability mostly.
The new munin plugin improves upon the last one by providing more information which is a little more useful than just knowing the maximum amplitude of the 1 second sample recorded at the time of running the plugin. At any rate I thought that was a cool little project I got myself into so I documented it here.
SAM
I posted an interesting solution so I'm sharing it here and a little more on this blog. See post #9 of this thread.
I'm going to expand upon that munin plugin and make it a little more robust and informative. I'll rewrite the munin plugin a bit to include more information on the same graph and be a little better.
Code:
#!/bin/sh
case $1 in
config)
cat <<EOM
graph_title Sound Amplitude
graph_args -l -1 --upper-limit 1
graph_vlabel Amplitude
graph_info Shows the sound amplitude values during the 1 second interval recorded discretely every minute.
mxamp.label max_ampl
mxamp.info Maximum amplitude
mnamp.label min_ampl
mnamp.info Minimum amplitude
mdamp.label mid_ampl
mdamp.info Midline amplitude
EOM
exit 0;;
esac
arecord -d 1 -f cd -t wav /tmp/foo.wav &> /dev/null
echo -n "mxamp.value "
sox /tmp/foo.wav -n stat 2>&1 | grep 'Maximum amplitude' | awk '{print $3}'
echo -n "mnamp.value "
sox /tmp/foo.wav -n stat 2>&1 | grep 'Minimum amplitude' | awk '{print $3}'
echo -n "mdamp.value "
sox /tmp/foo.wav -n stat 2>&1 | grep 'Midline amplitude' | awk '{print $3}'
rm -f /tmp/foo.wav
The new munin plugin improves upon the last one by providing more information which is a little more useful than just knowing the maximum amplitude of the 1 second sample recorded at the time of running the plugin. At any rate I thought that was a cool little project I got myself into so I documented it here.
SAM
Total Comments 0



