Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.