c
This commit is contained in:
@@ -310,17 +310,23 @@ if RUMPS_AVAILABLE:
|
|||||||
|
|
||||||
def transcription_loop(self):
|
def transcription_loop(self):
|
||||||
"""Main transcription loop running in background thread."""
|
"""Main transcription loop running in background thread."""
|
||||||
|
print("test1")
|
||||||
while self.is_running and not self.stop_event.is_set():
|
while self.is_running and not self.stop_event.is_set():
|
||||||
|
print("test2")
|
||||||
try:
|
try:
|
||||||
if not self.is_paused and self.recorder:
|
if not self.is_paused and self.recorder:
|
||||||
|
print("test3")
|
||||||
text = self.recorder.text()
|
text = self.recorder.text()
|
||||||
|
print("test4")
|
||||||
if text and text.strip():
|
if text and text.strip():
|
||||||
|
print("test5")
|
||||||
self.on_transcription_complete(text)
|
self.on_transcription_complete(text)
|
||||||
else:
|
else:
|
||||||
time.sleep(0.1) # Small delay when paused
|
time.sleep(0.1) # Small delay when paused
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Transcription error: {e}")
|
print(f"Transcription error: {e}")
|
||||||
time.sleep(1) # Longer delay on error
|
time.sleep(1) # Longer delay on error
|
||||||
|
print("test")
|
||||||
|
|
||||||
def on_realtime_transcription(self, text: str):
|
def on_realtime_transcription(self, text: str):
|
||||||
"""Handle real-time transcription updates."""
|
"""Handle real-time transcription updates."""
|
||||||
|
|||||||
Reference in New Issue
Block a user