示例#1
0
def pause_audio(audio: pygame.mixer.Sound) -> None:
    audio.stop()
示例#2
0
 def play_sound(sound: pygame.mixer.Sound) -> None:
     if Window.__enable_sound and isinstance(sound, pygame.mixer.Sound):
         sound.play()
示例#3
0
def play_audio(audio: pygame.mixer.Sound, loop=False) -> None:
    audio.play(-1 if loop else 0)
示例#4
0
def play_audio(audio: pygame.mixer.Sound, loop=False) -> None:
    audio.play(-1 if loop else 0)
示例#5
0
def pause_audio(audio: pygame.mixer.Sound) -> None:
    audio.stop()
示例#6
0
 def play(self, sound: pygame.mixer.Sound):
     if not PLAY_SOUNDS:
         return
     if self.get_enabled():
         sound.play()
示例#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()