I am trying to make an AV bug raspberry pi for a class.
I am using sox to record sound.
Which is working fine.
the issue is sox needs to be stopped by a control+C to stop and create the new file. If killall is sent from a different ssh session it will drop the other session and sox will not create the file.
NOW=$( date '+%F_%H:%M:%S' )
sox -t alsa plughw:1 $NOW.wav;
I have tried making a separate script for stopping it; pretty much
ps | grep sox | kill 0;
Then run a
Any advice on how to stop sox in a way that would still produce an output file would be great. This will ideally be set to run at set times so avoiding human interaction is essential.