Hello all

Does anyone know of a tool chain or a way of scripting this:

1. start recording from a line-in port as soon as the sound level goes above a certain threshold
2.stop recording after it goes below the threshold for a certain amount of time,
3. save the whole recording in some kind of PCM format with the file name being the time and date the recording started.

One possible application could be security, but the application I'm going to use it for is recording music.

Just looking for some resources or maybe one of you has done this before?