rms_analysis.py : Don't crash in write_audacity_label_files() when seq.json does not exist.

This commit is contained in:
kevin 2021-01-18 10:36:06 -05:00
parent f36e7c8a64
commit 7119fe471b

View File

@ -254,7 +254,7 @@ def note_stats( r, decay_pct=50.0, extraDurSearchMs=500 ):
def locate_peak_indexes( xV, xV_srate, eventMsL, audioFn ):
def locate_peak_indexes( xV, xV_srate, eventMsL, audioFn="" ):
pkIdxL = []
for i, (begMs, endMs) in enumerate(eventMsL):
@ -601,6 +601,9 @@ def write_audacity_label_files( inDir, analysisArgsD, reverseFl=True ):
takeDir = os.path.join(pitchDir,takeFolder)
if not os.path.isfile(os.path.join(takeDir,"seq.json")):
continue
r = rms_analysis_main( takeDir, midi_pitch, **analysisArgsD )
labelFn = os.path.join(takeDir,"audacity.txt")