the following commands : start by listing all input devices. Then bind my driver and device as the default input sources:
arecord -l card 2: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio] export AUDIODRIVER=alsa export AUDIODEV=hw:2,0 from above, Card 2, Device 0 rec -c 1 "/chemin/fichier.wav"
All we need is the SoX record command :
rec -c 1 "/chemin/fichier.wav" trim 0 10
In this next example, we’ll capture audio when a noise triggers it :
rec -c 1 "/chemin/fichier.wav" silence 1 0.1 5% 1 1.0 5%
it only capture audio once a noise threshold is reached.
Lorsque le niveau sonore est plus faile que la limite donnée, l'enregistrement cesse.
next example, we will not stop the recording process when the threshold dips below our set value. Ceci permet de ne pas arrêter l'enregistrement :
rec -c 1 "/chemin/fichier.wav" silence 1 0.2 0.165% -1 0.2 0.165%