I wanted some program to record sound if some sound detected, i was not able to find one, so i started my own
Introduction
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
Installation
for most *nix systems:
install libvorbis, libogg, portaudio, boost (with development headers)
wget -t0 -c
http://sss.chaoslab.ru/git/?p=misc.git;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
http://sss.chaoslab.ru/tracker/misc/downloads/6 , also makefile for mxe included in repository, but need to be edited first.
Users Guide
usage:
./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
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