From 5b43c7412763b4bdd219168c871d2f8a9a461411 Mon Sep 17 00:00:00 2001 From: JacobGlennAyers Date: Tue, 9 Jan 2024 22:06:52 -0800 Subject: [PATCH] Bug Fixes - addressed threshold min handling when key isn't used by user - Added back in try-catch block when generating local score arrays --- PyHa/IsoAutio.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PyHa/IsoAutio.py b/PyHa/IsoAutio.py index 1cb77fc..c391042 100644 --- a/PyHa/IsoAutio.py +++ b/PyHa/IsoAutio.py @@ -625,7 +625,7 @@ def stack_isolate( time_per_score = samples_per_score / SAMPLE_RATE # Calculating local scores that are at or above threshold - thresh_scores = local_scores >= max(thresh, isolation_parameters["threshold_min"]) + thresh_scores = local_scores >= max(thresh, threshold_min) # Set up to find the starts and ends of clips thresh_scores = np.append(thresh_scores, [0]) @@ -1343,13 +1343,13 @@ def generate_automated_labels_template_matching( continue # generating local score array from clip - #try: - local_score_arr = template_matching_local_score_arr(SIGNAL, SAMPLE_RATE, TEMPLATE_spec, n, TEMPLATE_std_dev) - #except KeyboardInterrupt: - # exit("Keyboard Interrupt") - #except BaseException: - # checkVerbose("Failed to collect local score array of " + audio_file, isolation_parameters) - # continue + try: + local_score_arr = template_matching_local_score_arr(SIGNAL, SAMPLE_RATE, TEMPLATE_spec, n, TEMPLATE_std_dev) + except KeyboardInterrupt: + exit("Keyboard Interrupt") + except BaseException: + checkVerbose("Failed to collect local score array of " + audio_file, isolation_parameters) + continue # passing through isolation technique try: