Esempio n. 1
0
def pause_audio(audio: pygame.mixer.Sound) -> None:
    audio.stop()
Esempio n. 2
0
 def play_sound(sound: pygame.mixer.Sound) -> None:
     if Window.__enable_sound and isinstance(sound, pygame.mixer.Sound):
         sound.play()
Esempio n. 3
0
def play_audio(audio: pygame.mixer.Sound, loop=False) -> None:
    audio.play(-1 if loop else 0)
Esempio n. 4
0
def play_audio(audio: pygame.mixer.Sound, loop=False) -> None:
    audio.play(-1 if loop else 0)
Esempio n. 5
0
def pause_audio(audio: pygame.mixer.Sound) -> None:
    audio.stop()
Esempio n. 6
0
 def play(self, sound: pygame.mixer.Sound):
     if not PLAY_SOUNDS:
         return
     if self.get_enabled():
         sound.play()
Esempio n. 7
0
def play(sound: pygame.mixer.Sound, volume=False) -> None:
    volume = get_sound_volume() if volume is False else volume/10  # 0->10 must be divided by ten to be in 0->1 range
    sound.set_volume(volume)
    sound.play()