chore: remove unused imports and dead code
This commit is contained in:
1 parent
2474a3662a
commit
a72cf4ad9c
5 files changed
+6
-77
No files matched your search
+1
-13
@@ -13,7 +13,7 @@ Run: make ast or .venv/bin/python sync_audio_test.py --config config.toml
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
import os, sys, math, argparse, pathlib
|
||||
import os, sys, math, argparse
|
||||
import numpy as np
|
||||
|
||||
# allow tomllib (py3.11+) with tomli fallback
|
||||
@@ -31,12 +31,6 @@ except ImportError as e:
|
||||
print(e, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
import soundfile as sf
|
||||
HAS_SF = True
|
||||
except ImportError:
|
||||
HAS_SF = False
|
||||
|
||||
try:
|
||||
import sounddevice as sd
|
||||
HAS_SD = True
|
||||
@@ -152,15 +146,9 @@ class SyncWindow(QtWidgets.QMainWindow):
|
||||
|
||||
# xcorr display — corr is already fftshifted
|
||||
N = len(self.corr)
|
||||
# lags in seconds for display
|
||||
total = len(self.a) + len(self.b) - 1
|
||||
n_pow2 = N
|
||||
# shifted lags: -N//2 .. N//2-1
|
||||
self.corr_lags = np.arange(N) - N//2
|
||||
self.corr_lags_sec = self.corr_lags / sr
|
||||
# find peak index in raw (unshifted) for decimation
|
||||
peak_raw_idx = int(np.argmax(np.abs(self.corr))) # this is fftshifted, peak near center
|
||||
# for decimation we need the index in the shifted array
|
||||
|
||||
central = QtWidgets.QWidget()
|
||||
self.setCentralWidget(central)
|
||||
|
||||
Reference in new issue
Block a user