From 27ace0c0614eeb41de675282c125749930b3b0f2 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Fri, 21 Jul 2023 15:44:45 -0600 Subject: [PATCH] fix combine-voice-tracks --- scripts/combine-voice-tracks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/combine-voice-tracks.py b/scripts/combine-voice-tracks.py index 3aa9d1c..ad03590 100644 --- a/scripts/combine-voice-tracks.py +++ b/scripts/combine-voice-tracks.py @@ -57,6 +57,9 @@ for json_filename in json_filenames: with open(json_filename, 'r') as f: timestamps = json.load(f) + if len(timestamps) == 0: + continue + wav_filename = json_filename.replace(".json", ".wav") wav = None with open(wav_filename, 'rb') as f: @@ -73,6 +76,7 @@ for json_filename in json_filenames: new_data = vstack((new_data, data)) for key, element in timestamps.items(): element = offset(element) + timestamps[key] = element if key in new_json: combined = combine(new_json[key], element) new_json[key] = combined