Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am attempting to invoke a bash action triggered by audio input. A very simple sound detection sensor (no record) with adjustable threshold utilizing a pc's onboard audio chipset and audio microphone would do the trick, something like the perl script at Nothing against perl, but I am hoping to eventually use this on a resource challenged hardware setup, so keeping things as close to the kernel and bash as possible is imperative. Along those lines, solutions using ALSA and OSS are also out of the mix. Is it possible to make use of proc and/or device nodes via bash to accomplish this task? Thanks for any enlightenment.

share|improve this question

Not unless someone does a binary extension to bash to configure the audio device... that requires both the ability to handle random binary data and the ability to issue audio-device-specific ioctl() calls.

share|improve this answer
dd bs=8k count=4 </dev/audio >testing-mic.raw records 32768 bytes of audio – cdaaawg Apr 16 '12 at 2:32
@cdaaawg, it does, at some default format/bit rate that you cannot control, and using that audio as a trigger (as per the OP's question) would be difficult from the shell. – geekosaur Apr 16 '12 at 2:35

dd bs=8k count=4 </dev/audio >testing-mic.raw records 32768 bytes of audio, while cat testing-mic.raw >/dev/audio will playback that recorded audio. I am unsure of how to handle that raw audio file to get a baseline out of it though

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .