diff --git a/menu.py b/menu.py index 5b0822d..8a3cbbb 100644 --- a/menu.py +++ b/menu.py @@ -278,6 +278,12 @@ def learn_sounds(sounds): and (f.split('.')[0].lower() not in ["game-intro", "music_menu"]) and (not f.lower().startswith("_"))] + # Sort the sound files alphabetically + soundFiles.sort() + + # Total number of sound files + totalSounds = len(soundFiles) + # Track last spoken index to avoid repetition lastSpoken = -1 @@ -286,7 +292,8 @@ def learn_sounds(sounds): while not returnToMenu: if currentIndex != lastSpoken: - speech.speak(soundFiles[currentIndex][:-4]) + # Speak the sound name followed by its position in the list + speech.speak(f"{soundFiles[currentIndex][:-4]}, {currentIndex + 1} of {totalSounds}") lastSpoken = currentIndex event = pygame.event.wait()