Motion - Sound Detector

I wanted some program to record sound if some sound detected, i was not able to find one, so i started my own


sound_detector just detect if sound higher when choosen level and start writing it to file with current date+time as it name

Detailed Description

implemented in c++ using portaudio, libvorbis, libogg and boost


for most *nix systems:

install libvorbis, libogg, portaudio, boost (with development headers)

wget -t0 -c;a=blob_plain;f=sound_detector/main.cpp;hb=refs/heads/sound_detector -O main.cpp

g++ main.cpp -march=native -O2 -std=gnu++0x -lportaudio -lboost_thread -lboost_system -lboost_date_time -lboost_filesystem -lvorbisenc -lvorbis -logg -o sound_detector

thats all, you can see available options on program run

for windows it's harder, i personally using mxe crosscompiller scripts for compilling with mingw, i providing binary build, it's upx compressed, can be downloaded here , also makefile for mxe included in repository, but need to be edited first.

Users Guide

./sound_detector -h -l -f -v -d <dev number> -o <path> -p <sec> -P <sec> -m <sec> -s <float percents> -S <float percents>
-h this help message
-l device list
-d device number from device list
-o output directory
-f fork to bakground
-v verbose
-P pre capture seconds
-p post capture seconds
-m minimum capture length
-s sound level in float value 5,0% default
-S minimum sound level to stop recording in float value 5,0% is default

Comments and Bug Reports

Note: in Arch Linux (posably others) the g++ include now needs

g++ main.cpp -march=native -Wall -O2 -std=gnu++11 -lportaudio -lboost_thread -lboost_system -lboost_date_time -lboost_filesystem -lvorbisenc -lvorbis -logg -o sound_detector

to find all the deps

-- DavidBishop - 25 Mar 2013

RelatedProjectsForm edit

ProjectSummary simple "motion" like programm, but for sound detection instead of video
ProjectStatus Alpha
ReleaseVersion 0.1
ProjectSubmitter Alexandr Gluzskiy
Topic revision: r6 - 09 Jun 2014, AlexandrGl
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.