From ccceacdbe4ed7564952c2fc4fea7d0b14a31f036 Mon Sep 17 00:00:00 2001 From: Honney OC Date: Mon, 14 Sep 2026 01:12:39 +0000 Subject: [PATCH] fix: audio in verify_sync --- verify_sync.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/verify_sync.py b/verify_sync.py index 779abbf..5082bfa 100644 --- a/verify_sync.py +++ b/verify_sync.py @@ -140,6 +140,7 @@ def apply_dark_theme(app: QtWidgets.QApplication): class AudioPlayer: def __init__(self): self.playing = False + self._stream = None self._lock = threading.Lock() def play(self, data: np.ndarray, sr: int): @@ -149,7 +150,7 @@ class AudioPlayer: sd.stop() self.playing = True try: - sd.play(data, samplerate=sr, blocking=False) + self._stream = sd.play(data, samplerate=sr, blocking=False) except Exception as e: print(f"audio play error: {e}", file=sys.stderr) self.playing = False @@ -158,6 +159,7 @@ class AudioPlayer: if HAS_SD: with self._lock: sd.stop() + self._stream = None self.playing = False