" just constantly
appears. Then: remember the value "Current level: ".
Next step is creating the file /usr/local/etc/listener.conf
Copy the example listener.conf to the location mentioned above and
edit it to suit your needs.
For example:
wav_path = /home/folkert/recordings
devname = /dev/dsp
detect_level = 800
min_duration = 1
max_duration = 300
rec_silence = 5
sample_rate = 44100
channels = 1
compression = ima-adpcm
from_pipe = 0
exec = /home/folkert/encode_sample
sample_rate
Sets the samplerate at which the samples are recorded.
Be warned: only the rates supported by your soundcard can be
entered here!
rec_silence
sets the number of seconds to keep on recording when
no sound is detected. if during those 5 seconds sound is detected
again, the timer is restarted.
min_duration
sets how many samples must be above the threshold (the
'detect_level') before recording starts.
The samplerate is set to 44.1kHz so if you set min_duration to
4410, the minimum length (duration) of sound before the recording
starts is: 0.1s (or: one tenth of a second).
max_duration
how long a sample may be before a new file is started
channels
sets the number of channels to record. default is 1 which
is mono, 2 is stereo
compression
sets the compressionmethod. Can be:
- u-law
- a-law
- ima-adpcm
- ms-adpcm
- gsm-6.10
If you omit the compression-line completely, no compression is
used.
from_pipe
sets wether listener is reading from a pipe fed by
listenersoundpipe. listenersoundpipe lets you split a sound-
device in two so that you can check 2 rooms with only one sound-
card. You need to create two pipes and start 2 listener processes,
each reading from one pipe.
exec
selects the script/program to execute after the sample was
recorded. This first (and only) parameter for that script is the
filename of the sample.
filter
lets you add one or more filters. these will be used when
detecting sounds. beware: sound is written to the wav-files BEFORE
the filtering is done. See the directory 'filter_lib_example' for
an example on how to write a filter for listener.
safe_after_filtersets wether to save the audio-data to disk
before or after the filtering. Before the filtering gives you the
original sound while after gives you the sound after processing
with the filter(s).
Enter 'on' or 'off'.
The final step is starting the program:
listener
and that's it!
Thanks to Hugo Hugo for adding code that enables
you to set some parameters from the commandline.
If you have any suggestions or anything else, do not hesitate
to contact me at the following e-mail address:
folkert@vanheusden.com