Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR] Autorecord #36

Open
mats-ng opened this issue Apr 15, 2020 · 3 comments
Open

[NFR] Autorecord #36

mats-ng opened this issue Apr 15, 2020 · 3 comments

Comments

@mats-ng
Copy link

mats-ng commented Apr 15, 2020

Hi, could the timemachine option in jack_capture be extended to start and end a recording automatically, based on the incoming signal passing a threshold value?

This would need four additional options to jack_capture - similar to the autorecord function in jack_timemachine[1]:

--autorecord -> enable autorecord
--begin-threshold -> dB level above which automatic recording will start
--end-threshold -> dB level below which automatic recording will stop
--end-time -> silence length before automatich recording ends

My use case would be building a headless multitrack recorder with a RaspberryPi, and with this additional new functionality jack_capture would fit the bill perfectly, ie. start "listening" on boot and (pre-)record whenever something is coming in through the system:capture* ports.

[1] swh/timemachine@0bddb47?diff=split

@kmatheussen
Copy link
Owner

Good suggestion

@pkillnine
Copy link

pkillnine commented Jun 2, 2020

To add to this, it would be good to have the timemachine option atuomatically enabled with a buffer of a few seconds or so, and when the begin-threshold is reached, it includes the few seconds before the threshold was reached. This would stop the very beginning of the audio being cut off, just before it's loud enough to start recording.

@BrainDamage
Copy link

just for the record, I have a setup using silentjack to detect the activity, the extra complication of the shell script is to debounce the activity because jack_capture issues a new session every time start/stop are sent instead of ignoring when there's a current one active

#!/bin/env sh
stateFile=/tmp/.recordingstate
windowTime=5
let prebufferTime=${windowTime}+1
debounceCode() {
	command="$1"
	echo "if grep -F -q -v ${command} ${stateFile}; then oscsend localhost 8875 /jack_capture/tm/${command};fi;echo "${command}" > ${stateFile}"
}

echo stop > "${stateFile}"
silentjack -q -p "${windowTime}" -- sh -c "$(debounceCode stop)" &
silentjack -r -q -p "${windowTime}" -- sh -c "$(debounceCode start)" &
jack_capture  --timemachine --timemachine-prebuffer "${prebufferTime}" --daemon --osc 8875 &

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants