I'm trying to find a way to monitor microphone input to catch a particular "event". In other words, something principally similar to a motion detector - to execute a command upon an event.

Currently I'm using a simple ffmpeg command to record the sound card input into a file:
ffmpeg -f oss -i /dev/dsp1.0 -vn -c libvorbis -f ogg $FILE

However, it's not a convenient way, I'd prefer to analyze it in real time.

Any ideas?
I would say including DTMF. But since there are DTMF decoders available (e.g. multimon), I would rather implement an overshoot detector, then pass the signal to another program.
You mean a squelch? Crude one is not complicated, following plays line-in to line-out, but snips hissy silent parts.



  • aloop_sql.c.txt
    2.5 KB · Views: 422
I've found a fork of multimon ― multimon-ng:

which supports FreeBSD, although some minor tweaks are necessary to compile. It works pretty well having different types of decoders including DTMF. It monitors /dev/dspX.Y device and prints detected symbols to stdout (or can be used to analyze a regular audio file).
The .Y is not needed, new dspX clone will automatically appear as needed.

There is something on the works by the big boys, virtual_oss and cuse sound promising for unusual uses.

I didn't realized that dsp clones are created automatically, although it indirectly follows from your C code, Juha.
That's really cool! Thanks!