i want to setup a microphone to raspberry pi and record a audio signal for 5 sec when baby starts cry. how the setup should be done? the microphone should record when baby starts crying.
if it was up to me, I would do as follow : record continuously using node.js (or C + Alsa API), and analyze the pcm data on the run, when the data is above average (noise) then you'll record it on a file or whatsoever. If I can improve your system a bit, once you'll be at this stage, send a sms/mail/whatever to your phone. After that improve your set up with a node.js server, so that once you got the notification, you can get to your server via a web interface and hear you baby crying. You can even add a webcam, and you'll end up with several hundred $ system.