From 8c57afe65bee232f082d37dd6cd596c1c76be458 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 17 Sep 2025 17:44:04 -0400 Subject: [PATCH] More playing with the mixer for stability and fewer or no clicks. --- display.py | 4 ++-- sound.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/display.py b/display.py index 16c7cc5..e1b9651 100644 --- a/display.py +++ b/display.py @@ -46,9 +46,9 @@ def initialize_gui(gameTitle): # Initialize audio system if not already done if not pygame.mixer.get_init(): - pygame.mixer.pre_init(44100, -16, 2, 1536) + pygame.mixer.pre_init(44100, -16, 2, 4096) pygame.mixer.init() - pygame.mixer.set_num_channels(64) + pygame.mixer.set_num_channels(48) pygame.mixer.set_reserved(0) # Reserve channel for cut scenes # Enable key repeat for volume controls diff --git a/sound.py b/sound.py index 054843c..f6cc95a 100644 --- a/sound.py +++ b/sound.py @@ -29,8 +29,9 @@ class Sound: self.volumeService = volumeService or VolumeService.get_instance() if not pygame.mixer.get_init(): + pygame.mixer.pre_init(44100, -16, 2, 4096) pygame.mixer.init() - pygame.mixer.set_num_channels(64) + pygame.mixer.set_num_channels(48) pygame.mixer.set_reserved(0) self.load_sounds()