|
@@ -66,6 +66,9 @@ dejavu = Dejavu({"database_type":"mem"})
|
|
device_id = config['device_id']
|
|
device_id = config['device_id']
|
|
device_path = os.path.join(base_path, device_id)
|
|
device_path = os.path.join(base_path, device_id)
|
|
recognizer = FilePerSecondRecognizer
|
|
recognizer = FilePerSecondRecognizer
|
|
|
|
+"""calibrations = {}
|
|
|
|
+device_ref = fbdb.reference('devices').child(config['device_id'])
|
|
|
|
+calibrations_ref = device_ref.child('calibrations')"""
|
|
|
|
|
|
# settings
|
|
# settings
|
|
queue_mode = QUEUE_THREAD
|
|
queue_mode = QUEUE_THREAD
|
|
@@ -164,6 +167,10 @@ def process_segment(item, audios=None):
|
|
|
|
|
|
log.info('processing segment: {}'.format(item))
|
|
log.info('processing segment: {}'.format(item))
|
|
|
|
|
|
|
|
+ """# 0. Obtener la información de calibración
|
|
|
|
+ calibration = calibrations_ref.child(station)
|
|
|
|
+ print(calibration)"""
|
|
|
|
+
|
|
# 1. obtener el audio desde firebase
|
|
# 1. obtener el audio desde firebase
|
|
# y calcular su fingerprint.
|
|
# y calcular su fingerprint.
|
|
filename, md5hash = cloud_download(ad_key=item['ad'])
|
|
filename, md5hash = cloud_download(ad_key=item['ad'])
|
|
@@ -180,7 +187,7 @@ def process_segment(item, audios=None):
|
|
segments_needed * SEGMENTS_TOLERANCE_RATE
|
|
segments_needed * SEGMENTS_TOLERANCE_RATE
|
|
))
|
|
))
|
|
except Exception as ex:
|
|
except Exception as ex:
|
|
- log.error('file {} is not an mp3'.format(audio))
|
|
|
|
|
|
+ log.error('file {} is not an mp3'.format(filename))
|
|
log.error(str(ex))
|
|
log.error(str(ex))
|
|
return
|
|
return
|
|
|
|
|