Merge pull request #821 from Normanras/audio_errors

Created try/except statement around reading the audio data
This commit is contained in:
ehpersonal38
2023-04-06 20:15:10 -04:00
committed by GitHub
+9 -1
View File
@@ -396,9 +396,17 @@ def handle_client(conn, addr):
birdweather_id = args.birdweather_id
# Read audio data
# Read audio data & handle errors
try:
audioData = readAudioData(args.i, args.overlap)
except (NameError, TypeError) as e:
print(f"Error with the following info: {e}")
open('~/BirdNET-Pi/analyzing_now.txt', 'w').close()
finally:
pass
# Get Date/Time from filename in case Pi gets behind
# now = datetime.now()
full_file_name = args.i