Another experimental sound change.
This commit is contained in:
@@ -289,14 +289,18 @@ def _play_dialog_sound(entry, dialog_config, sounds):
|
||||
if hasattr(sounds, 'sounds') and sound_to_play in sounds.sounds:
|
||||
# Sound class instance (like from libstormgames Sound class)
|
||||
sound_obj = sounds.sounds[sound_to_play]
|
||||
channel = sound_obj.play()
|
||||
from .sound import get_available_channel
|
||||
channel = get_available_channel()
|
||||
channel.play(sound_obj)
|
||||
sound_duration = sound_obj.get_length()
|
||||
if sound_duration > 0:
|
||||
pygame.time.wait(int(sound_duration * 1000))
|
||||
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]
|
||||
channel = sound_obj.play()
|
||||
from .sound import get_available_channel
|
||||
channel = get_available_channel()
|
||||
channel.play(sound_obj)
|
||||
sound_duration = sound_obj.get_length()
|
||||
if sound_duration > 0:
|
||||
pygame.time.wait(int(sound_duration * 1000))
|
||||
|
Reference in New Issue
Block a user