Add music in breaks

For #12
This commit is contained in:
Clement Desmidt 2023-06-15 11:30:47 +02:00
parent 1d080dc103
commit e27769c8f3
3 changed files with 6 additions and 0 deletions

BIN
assets/sounds/elevator.mp3 Normal file

Binary file not shown.

View File

@ -20,8 +20,10 @@ class ImagePlaceholder:
if image_path == "break":
self.is_break = True
image_path = 'assets/images/break.jpg'
self.image_window.play_elevator()
else:
self.is_break = False
self.image_window.elevator_sound.stop()
self.current_original_image = Image.open(image_path)
self.current_image = copy.deepcopy(self.current_original_image)
self.apply_options()

View File

@ -26,6 +26,7 @@ class ImageWindow:
mixer.init()
self.countdown_sound = mixer.Sound('assets/sounds/countdown.mp3')
self.elevator_sound = mixer.Sound('assets/sounds/elevator.mp3')
self.images = []
self.current_image = None
@ -71,3 +72,6 @@ class ImageWindow:
def play_countdown(self):
self.countdown_sound.play()
def play_elevator(self):
self.elevator_sound.play()