|
@@ -69,7 +69,8 @@ recognizer = FilePerSecondRecognizer
|
|
|
|
|
|
# settings
|
|
# settings
|
|
queue_mode = QUEUE_THREAD
|
|
queue_mode = QUEUE_THREAD
|
|
-threshold_mode = THRESHOLD_AVERAGE
|
|
|
|
|
|
+threshold_mode = THRESHOLD_FIXED
|
|
|
|
+should_index_empty = True
|
|
|
|
|
|
db_path = config.get('localDatabase', os.path.join(device_path, 'files.db'))
|
|
db_path = config.get('localDatabase', os.path.join(device_path, 'files.db'))
|
|
db = sqlite3.connect(db_path)
|
|
db = sqlite3.connect(db_path)
|
|
@@ -218,7 +219,14 @@ def process_segment(item, audios=None):
|
|
except KeyError as ex:
|
|
except KeyError as ex:
|
|
the_key = str(ex)
|
|
the_key = str(ex)
|
|
if the_key == 'confidence':
|
|
if the_key == 'confidence':
|
|
- log.warning('Invalid confidence')
|
|
|
|
|
|
+ if should_index_empty:
|
|
|
|
+ results.append({
|
|
|
|
+ 'confidence': 0,
|
|
|
|
+ 'timestamp': ts,
|
|
|
|
+ 'offset': match['offset']
|
|
|
|
+ })
|
|
|
|
+ else:
|
|
|
|
+ log.warning('Invalid confidence')
|
|
else:
|
|
else:
|
|
log.warning(the_key)
|
|
log.warning(the_key)
|
|
|
|
|