More work on trying to reduce pops and clicks, especially in Windows.

This commit is contained in:
Storm Dragon
2025-09-17 15:26:48 -04:00
parent acb899e6eb
commit 0bbf35a4c5
2 changed files with 7 additions and 7 deletions

View File

@@ -44,11 +44,12 @@ def initialize_gui(gameTitle):
pygame.display.set_mode((800, 600))
pygame.display.set_caption(gameTitle)
# Set up audio system
pygame.mixer.pre_init(44100, -16, 2, 512)
pygame.mixer.init()
pygame.mixer.set_num_channels(32)
pygame.mixer.set_reserved(0) # Reserve channel for cut scenes
# Initialize audio system if not already done
if not pygame.mixer.get_init():
pygame.mixer.pre_init(44100, -16, 2, 1536)
pygame.mixer.init()
pygame.mixer.set_num_channels(64)
pygame.mixer.set_reserved(0) # Reserve channel for cut scenes
# Enable key repeat for volume controls
pygame.key.set_repeat(500, 100)