Closed allebb closed 7 years ago
This has now been implemented, I used the follow to spawn 'sox' process (and get the PID) and then kill it using another system command:-
$pid = system($this->audioService->audioRecordBin . ' -t ' . $this->config->get('record_device',
'alsa') . ' default ' . $this->basePath . '/storage/input/buffer.ogg > /dev/null & echo $!');
// Then kill it like so:
system('kill ' . $pid);
The
mainVox
loop needs to be able to stop the execution of thesox
binary when the COS signal goes low, will need to further look into the most efficent way to do this but most likely to involve open a new process, store the PID in memory and then usekill
on the process after the COS signal goes high.