0

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 http://photodoto.com/index.php/2008/02/25/tethered-shooting-with-linux/ 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.

2 Answers 2

0

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.

2
  • dd bs=8k count=4 </dev/audio >testing-mic.raw records 32768 bytes of audio
    – cdaaawg
    Commented Apr 16, 2012 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
    Commented Apr 16, 2012 at 2:35
0

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

You must log in to answer this question.

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