Browse Source

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

master
kevin 3 years ago
parent
commit
7119fe471b
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      rms_analysis.py

+ 4
- 1
rms_analysis.py View File

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

Loading…
Cancel
Save