WMICraft/sound/audioHandler.py

18 lines
444 B
Python
Raw Normal View History

2022-03-13 15:50:29 +01:00
from random import choice
from pygame import mixer
class gamePlaylist:
wavFiles = ["sound/2mm.ogg", "sound/3.ogg", "sound/4.ogg", "sound/5.ogg"]
wavMenu = ["sound/1.ogg"]
def gameAudio(self):
wavRandom = choice(gamePlaylist.wavFiles)
mixer.music.load(wavRandom)
mixer.music.play()
def menuAudio(self):
w = choice(gamePlaylist.wavMenu)
mixer.music.load(w)
mixer.music.play(-1)