fix: verify_sync
This commit is contained in:
1 parent
82f9e6baea
commit
ad3a41b013
3 files changed
+9
-9
No files matched your search
@@ -84,7 +84,7 @@ sync:
|
||||
@if [ -x $(PY) ]; then $(PY) apply_sync.py --config $(CONFIG) --lag $(LAG); else python3 apply_sync.py --config $(CONFIG) --lag $(LAG); fi
|
||||
|
||||
verify:
|
||||
@if [ -x $(PY) ]; then QT_STYLE_OVERRIDE=Fusion $(PY) verify_sync.py --config $(CONFIG) --lag $(LAG); else QT_STYLE_OVERRIDE=Fusion python3 verify_sync.py --config $(CONFIG) --lag $(LAG); fi
|
||||
@if [ -x $(PY) ]; then LC_NUMERIC=C QT_STYLE_OVERRIDE=Fusion $(PY) verify_sync.py --config $(CONFIG) --lag $(LAG); else LC_NUMERIC=C QT_STYLE_OVERRIDE=Fusion python3 verify_sync.py --config $(CONFIG) --lag $(LAG); fi
|
||||
|
||||
ast:
|
||||
@AUDIO_A=$$(python3 -c "import tomllib; c=tomllib.load(open('config.toml','rb')); print(c['extract'].get('file_a',''))" 2>/dev/null); \
|
||||
@@ -100,7 +100,7 @@ ast:
|
||||
else \
|
||||
echo "=> extracted wavs exist ($$OUT/$${STEM_A}_audio.wav, $$OUT/$${STEM_B}_audio.wav), skipping extract"; \
|
||||
fi
|
||||
@if [ -x $(PY) ]; then QT_STYLE_OVERRIDE=Fusion $(PY) sync_audio_test.py --config $(CONFIG); else QT_STYLE_OVERRIDE=Fusion python3 sync_audio_test.py --config $(CONFIG); fi
|
||||
@if [ -x $(PY) ]; then LC_NUMERIC=C QT_STYLE_OVERRIDE=Fusion $(PY) sync_audio_test.py --config $(CONFIG); else LC_NUMERIC=C QT_STYLE_OVERRIDE=Fusion python3 sync_audio_test.py --config $(CONFIG); fi
|
||||
|
||||
clean:
|
||||
rm -rf $(VENV) __pycache__ .pytest_cache
|
||||
+3
-2
@@ -38,6 +38,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
|
||||
|
||||
|
||||
|
||||
@@ -126,9 +127,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, _loader=load_wav)
|
||||
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, _loader=load_wav)
|
||||
# keep originals for lag apply
|
||||
self.a_orig = self.a.copy()
|
||||
self.b_orig = self.b.copy()
|
||||
|
||||
+4
-5
@@ -22,11 +22,9 @@ Usage:
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
import os, sys, math, argparse, subprocess, json, shutil, threading, tempfile, warnings, locale, signal
|
||||
import os, sys, math, argparse, subprocess, json, shutil, threading, tempfile, warnings, signal
|
||||
import numpy as np
|
||||
|
||||
locale.setlocale(locale.LC_NUMERIC, "C")
|
||||
|
||||
warnings.filterwarnings("ignore", category=RuntimeWarning, module="pyqtgraph")
|
||||
|
||||
try:
|
||||
@@ -57,6 +55,7 @@ except ImportError:
|
||||
HAS_SD = False
|
||||
|
||||
from sync_audio import load_wav
|
||||
from waveform_cache import cached_load_wav
|
||||
|
||||
|
||||
# ─── Helpers ───
|
||||
@@ -205,9 +204,9 @@ class VerifyWindow(QtWidgets.QMainWindow):
|
||||
|
||||
# Load audio
|
||||
print(f"Loading audio A: {wav_a_path}")
|
||||
self.a_orig, _ = load_wav(wav_a_path, target_sr=sr)
|
||||
self.a_orig, _ = cached_load_wav(wav_a_path, target_sr=sr, _loader=load_wav)
|
||||
print(f"Loading audio B: {wav_b_path}")
|
||||
self.b_orig, _ = load_wav(wav_b_path, target_sr=sr)
|
||||
self.b_orig, _ = cached_load_wav(wav_b_path, target_sr=sr, _loader=load_wav)
|
||||
|
||||
# Apply lag alignment
|
||||
self.a_aligned, self.b_aligned = apply_lag(self.a_orig, self.b_orig, self.lag_samples)
|
||||
|
||||
Reference in new issue
Block a user