Install audio-recorder

sudo add-apt-repository -y ppa:audio-recorder/ppa
sudo apt-get update
sudo apt-get install -y audio-recorder
 
start if sound  0.25
stop if silence 3s 0.25

Docu
/usr/share/audio-recorder/timer-syntax.html