Skip to content

Commit

Permalink
Pygame mixer init before pygame init, also trying other values to pre…
Browse files Browse the repository at this point in the history
…_init
  • Loading branch information
Samuel Senior committed Jun 3, 2020
1 parent 2ae2c50 commit 1b21f82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,9 @@ def loadBells(self):
self.bells[i+1] = self.mixer.Sound(os.path.join(self.exeDir, "..", "audio", "{}.wav".format(i+1)))

def playBell(self):
pygame.mixer.pre_init(frequency=44100, size=16, channels=self.config.get('numberOfBells'))
pygame.mixer.init()

self.mixer = pygame.mixer
#self.mixer.set_num_channels(self.config.get('numberOfBells'))
self.mixer.set_num_channels(self.config.get('numberOfBells'))

self.loadBells()

Expand Down
4 changes: 2 additions & 2 deletions src/rebel.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class Rebel(Log):
def __init__(self, menuWidth, menuHeight, mainWidth, mainHeight, configFile=os.path.join("..", "config", "config.txt")):

# initialize
pygame.mixer.pre_init(frequency=44100, allowedchanges=0, buffer=1024)#size=16)
pygame.init()
#pygame.mixer.pre_init(frequency=44100, size=16, channels=1)
#pygame.mixer.init()
pygame.mixer.init()
pygame.font.init()

if getattr(sys, 'frozen', False):
Expand Down

0 comments on commit 1b21f82

Please sign in to comment.