how do I go about making a script that starts by audio input? ie. microphone triggering.
@NOISEBOB #HowTo run #ShellScript when sound in mic
Here is a #bash function "getvol" which uses #SoX to listen for 0.1 second and then tells you peak volume, between 0 and 1:
function getvol {
rec -p trim 0 .1 stat 2>&1 >/dev/null | grep -Po "(?<=Maximum amplitude:).*" | grep -Po "\S+"
}
You can loop the function and do something if the volume is high enough.
@pelle i love sox!