Audio capture records exactly SUNRISE_TARGET_SECS centred on sunrise

Previously sunrise-audio-capture.sh recorded the entire capture window
(70+ minutes) and daily_sunrise_video.sh sought to the right position with
a complex offset calculation.

Now: record floor(TARGET/2) seconds before sunrise and ceil(TARGET/2) after —
odd second goes to post-sunrise.  The file is exactly SUNRISE_TARGET_SECS long
and already centred, so no offset is needed when mixing.

AUDIO_PRE_BUFFER_MIN removed — it was part of the old whole-window scheme
and is no longer meaningful.

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-20 00:22:35 +00:00
parent be714affc0
commit 4814c9e158
3 changed files with 20 additions and 15 deletions
+2 -1
View File
@@ -283,8 +283,9 @@ CAPTURE_INTERVAL=10
# The audio file is deleted automatically after it is mixed into the video.
#
AUDIO_ENABLED=false # set true if your camera has a working mic
AUDIO_PRE_BUFFER_MIN=2 # extra minutes to start before the capture window
CAPTURE_AUDIO_BITRATE=96k # bitrate for the sunrise audio recording
# Audio is recorded for exactly SUNRISE_TARGET_SECS, centred on actual sunrise:
# floor(TARGET/2) seconds before, ceil(TARGET/2) after (odd second → post-sunrise).
# ── Mattermost — daily sunrise upload ─────────────────────────────────────────
# mattermost_url, access_token, channel_id go in .env (see bottom of this file).