From 25d54a4f5e6d390c5fe21ed7b4ea9911389ff480 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 21 Sep 2025 22:15:19 -0400 Subject: [PATCH] Potential fix for dialogues when running from pyinstaller compiled code. --- speech.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/speech.py b/speech.py index 7b905c6..7c6c718 100644 --- a/speech.py +++ b/speech.py @@ -294,6 +294,7 @@ def _play_dialog_sound(entry, dialog_config, sounds): sound_duration = sound_obj.get_length() if sound_duration > 0: pygame.time.wait(int(sound_duration * 1000)) + pygame.event.pump() # Clear any events queued during sound playback elif isinstance(sounds, dict) and sound_to_play in sounds: # Dictionary of pygame sound objects (like from initialize_gui) sound_obj = sounds[sound_to_play] @@ -303,10 +304,12 @@ def _play_dialog_sound(entry, dialog_config, sounds): sound_duration = sound_obj.get_length() if sound_duration > 0: pygame.time.wait(int(sound_duration * 1000)) + pygame.event.pump() # Clear any events queued during sound playback elif hasattr(sounds, 'play'): # Try using a play method if available sounds.play(sound_to_play) pygame.time.wait(500) # Default delay if can't get duration + pygame.event.pump() # Clear any events queued during sound playback except Exception: # Sound missing or error - continue silently without crashing pass