feat: add waveform cache to avoid re-reading WAV files
This commit is contained in:
1 parent
37f19c5fd3
commit
4404dda926
3 files changed
+35
-4
No files matched your search
+3
-2
@@ -44,6 +44,7 @@ except ImportError:
|
||||
HAS_SD = False
|
||||
|
||||
from sync_audio import load_wav, correlate, device_info, lag_to_seconds
|
||||
from waveform_cache import cached_load_wav
|
||||
|
||||
|
||||
def load_config(path: str) -> dict:
|
||||
@@ -131,9 +132,9 @@ class SyncWindow(QtWidgets.QMainWindow):
|
||||
|
||||
# load
|
||||
print(f"Loading {a_path}")
|
||||
self.a, self.sr_a = load_wav(a_path, target_sr=sr)
|
||||
self.a, self.sr_a = cached_load_wav(a_path, target_sr=sr)
|
||||
print(f"Loading {b_path}")
|
||||
self.b, self.sr_b = load_wav(b_path, target_sr=sr)
|
||||
self.b, self.sr_b = cached_load_wav(b_path, target_sr=sr)
|
||||
# keep originals for lag apply
|
||||
self.a_orig = self.a.copy()
|
||||
self.b_orig = self.b.copy()
|
||||
|
||||
Reference in new issue
Block a user