Create try/except statement around reading the audio data from the recordings. See the issue linked in the PR. By clearing the text in analyzing_now, my system moves past the error-causing file and continues processing.
This commit is contained in:
+10
-2
@@ -395,8 +395,16 @@ def handle_client(conn, addr):
|
|||||||
|
|
||||||
birdweather_id = args.birdweather_id
|
birdweather_id = args.birdweather_id
|
||||||
|
|
||||||
# Read audio data
|
# Read audio data & handle errors
|
||||||
audioData = readAudioData(args.i, args.overlap)
|
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
|
# Get Date/Time from filename in case Pi gets behind
|
||||||
# now = datetime.now()
|
# now = datetime.now()
|
||||||
|
|||||||
Reference in New Issue
Block a user