printf"Error: ffmpeg failed to capture audio stream\n"
printf"Error: ffmpeg failed to capture audio stream\n"
exit1
exit1
fi
fi
printf"Buffering audio. Please wait...\n"
# For some reason, the initial buffer can end up smaller than step_s (even though we sleep for step_s)
printf"Buffering audio. Please wait...\n\n"
sleep $(($step_s*2))
sleep $(($step_s))
# do not stop script on error
set +e
i=0
i=0
while[true];do
SECONDS=0
# a handy bash built-in, SECONDS,
while[$running -eq 1];do
# > "This variable expands to the number of seconds since the shell was started. Assignment to this variable resets the count to the value assigned, and the expanded value becomes the value assigned
# > plus the number of seconds since the assignment."
SECONDS=0
# extract the next piece from the main file above and transcode to wav. -ss sets start time and nudges it by -0.5s to catch missing words (??)
# extract the next piece from the main file above and transcode to wav. -ss sets start time and nudges it by -0.5s to catch missing words (??)