Fixed voice preview player keeps open at the background

This commit is contained in:
Deniz Şafak
2025-05-21 04:54:13 +03:00
parent 0d7e746516
commit fd10aab6f3
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -919,8 +919,9 @@ class PlayAudioThread(QThread):
pygame.mixer.music.play()
# Wait until playback is finished
while pygame.mixer.music.get_busy():
_time.sleep(0.1)
_time.sleep(0.2)
pygame.mixer.music.unload()
pygame.mixer.quit() # Quit the mixer
self.finished.emit()
except Exception as e:
self.error.emit(f"Audio playback error: {str(e)}")