working to the minute

This commit is contained in:
Patrick McGuire
2021-09-28 16:35:24 -04:00
parent 09bc1b94a5
commit 35c44a4516
3 changed files with 11 additions and 27 deletions
+6 -3
View File
@@ -26,7 +26,7 @@ get_files() {
move_analyzed() {
echo "Starting move_analyzed() for ${1}"
for i in "${files[@]}";do
j="$(echo "${i}" | cut -d'.' -f1).BirdNET.selections.txt"
j="$(echo "${i}" | cut -d'.' -f1-2).csv"
if [ -f "${1}/${j}" ];then
if [ ! -d "${1}-Analyzed" ];then
mkdir -vvvvvvvp "${1}-Analyzed" && echo "'Analyzed' directory created"
@@ -46,14 +46,17 @@ run_analysis() {
echo "Starting run_analysis() for ${1}"
WEEK=$(date --date="${2}" +"%U")
cd ${HOME}/BirdNET-Lite || exit 1
FILES=("$(find ${1} | tail -n+2)")
for i in "${files[@]}";do
python3 analyze.py \
--i "${1}" \
--o "${1}.csv" \
--i "${1}/${i}" \
--o "${1}/${i}.csv" \
--lat "${LATITUDE}" \
--lon "${LONGITUDE}" \
--week "${WEEK}" \
--overlap "${OVERLAP}" \
--min_conf "${CONFIDENCE}"
done
}
# The three main functions
+4 -4
View File
@@ -6,11 +6,11 @@ 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 60 \
--use-strftime ${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-%I:%M%P.wav
arecord -f S16_LE -c${CHANNELS} -r48000 -t wav --max-file-time 25\
--use-strftime ${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-%I:%M:%S%P.wav
else
arecord -f S16_LE -c${CHANNELS} -r48000 -t wav --max-file-time 60 \
arecord -f S16_LE -c${CHANNELS} -r48000 -t wav --max-file-time 25\
-D "${REC_CARD}" --use-strftime \
${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-%I:%M%P.wav
${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-%I:%M:%S%P.wav
fi
fi