This commit is contained in:
dingfeng.wong
2025-07-23 11:23:14 +08:00
parent a572ca003f
commit 6e2bda5cfb
+6
View File
@@ -310,17 +310,23 @@ if RUMPS_AVAILABLE:
def transcription_loop(self):
"""Main transcription loop running in background thread."""
print("test1")
while self.is_running and not self.stop_event.is_set():
print("test2")
try:
if not self.is_paused and self.recorder:
print("test3")
text = self.recorder.text()
print("test4")
if text and text.strip():
print("test5")
self.on_transcription_complete(text)
else:
time.sleep(0.1) # Small delay when paused
except Exception as e:
print(f"Transcription error: {e}")
time.sleep(1) # Longer delay on error
print("test")
def on_realtime_transcription(self, text: str):
"""Handle real-time transcription updates."""