Commit f45991da authored by santiago duque's avatar santiago duque

safe try catch for no index audio

parent 31af0a4e
...@@ -47,7 +47,11 @@ def play_sound(index): ...@@ -47,7 +47,11 @@ def play_sound(index):
if not cut_current_sound: if not cut_current_sound:
current_sound_index = index current_sound_index = index
channel = sound_array[current_sound_index].play()
try:
channel = sound_array[current_sound_index].play()
except Exception as X:
print("no sound with this index: " + current_sound_index + " | " + X)
while channel.get_busy(): while channel.get_busy():
pygame.time.wait(150) # ms pygame.time.wait(150) # ms
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment