Fixed run on missing sample
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-09-30 05:40:54 +02:00
parent d4e6feb083
commit 876de01e3c

View File

@ -39,6 +39,9 @@ class SoundSignalProcessor(AbcSignalProcessor):
""" """
soundsample_name = self.soundsensor.getvalue() soundsample_name = self.soundsensor.getvalue()
if not soundsample_name: # No new sample... nothing to do
return
try: try:
sample_decision = self.soundpreprocessor.preprocesssignal(soundsample_name) sample_decision = self.soundpreprocessor.preprocesssignal(soundsample_name)
except Exception as e: except Exception as e:
@ -58,4 +61,4 @@ class SoundSignalProcessor(AbcSignalProcessor):
os.unlink(soundsample_name) os.unlink(soundsample_name)
return return
os.unlink(soundsample_name) os.unlink(soundsample_name)