1

I am working on a Raspberry Pi project with the goal to detect sound and turn on a webcam as a result of the detected sound.

I am not sure how I will be able to let the program react to the detected sound by the microphone. Can someone show me some basic Python code which will use the sound and do 'something' with it? It is okay if it would only print a string; I just need to see how the sound is being detected and used in the program.

Hein de Wilde
  • 187
  • 1
  • 4
  • 11
  • This: http://stackoverflow.com/questions/1936828/how-get-sound-input-from-microphone-in-python-and-process-it-on-the-fly and then this: http://stackoverflow.com/questions/2668442/detect-and-record-a-sound-with-python – gidim Aug 30 '16 at 22:30
  • If you have no idea at all, you may be better posting on http://raspberrypi.stackexchange.com/ – Padraic Cunningham Aug 30 '16 at 22:33

1 Answers1

0

I would prescribe the code described here, and replace the audio recording part with whatever you are using to capture video (I would recommend the picamera module, and additionally, the imutils module, for capturing video frames):

Python: Record audio based on audio input threshold

Community
  • 1
  • 1