예제 #1
0
파일: g2d_pyg.py 프로젝트: tomamic/fondinfo
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
파일: g2d_pyg.py 프로젝트: tomamic/fondinfo
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()