010dec34ee
more efficient extraction.service cleaner birdnet_analysis logging cleaner birdnet.conf functioning species_notifier
23 lines
557 B
Bash
Executable File
23 lines
557 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -x
|
|
source /etc/birdnet/birdnet.conf
|
|
|
|
if [ "${TIMESTAMP_FORMAT}" == "12" ];then
|
|
STAMP="%I:%M:%S%P"
|
|
else
|
|
STAMP="%H:%M:%S"
|
|
fi
|
|
|
|
if pgrep arecord &> /dev/null ;then
|
|
echo "Recording"
|
|
else
|
|
if [ -z ${REC_CARD} ];then
|
|
arecord -f S16_LE -c${CHANNELS} -r48000 -t wav --max-file-time 6\
|
|
--use-strftime ${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-${STAMP}.wav
|
|
else
|
|
arecord -f S16_LE -c${CHANNELS} -r48000 -t wav --max-file-time 6\
|
|
-D "${REC_CARD}" --use-strftime \
|
|
${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-${STAMP}.wav
|
|
fi
|
|
fi
|